Home > fvcom_prepro > make_model_nml_generic.m

make_model_nml_generic

PURPOSE ^

script to create the model run namelist

SYNOPSIS ^

function make_model_nml_generic(inputConf,yy,mm)

DESCRIPTION ^

 script to create the model run namelist
 fname='nador_year2046_automatic.nml';
 fnml=fopen(fname,'wt');
 parameters to change for this run

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function make_model_nml_generic(inputConf,yy,mm)
0002 % script to create the model run namelist
0003 % fname='nador_year2046_automatic.nml';
0004 % fnml=fopen(fname,'wt');
0005 % parameters to change for this run
0006 days2sec=24*60*60;
0007 
0008 % inputConf.modelYear= 2006;
0009 % inputConf.casename= 'aqua_v14';
0010 % inputConf.base= '/data/medusa/rito/models/FVCOM/runVigo/';
0011 % inputConf.version= 'ver3.2.1'
0012 % inputConf.SIGMA_LEVELS_FILE     = 'sigma_geom.dat';
0013 % inputConf.report= 60 % interval to report to the screen in model minutes
0014 % for mm=8:10;
0015 inputConf.startDate= [yy mm 01 00 00 00 ];
0016 inputConf.endDate=[yy mm+1 01 00 00 00 ];
0017 %% Entries to change
0018 % these cannot be left to the default values
0019 inputConf.EXTSTEP_SECONDS =inputConf.timestep;
0020 inputConf.IRAMP = floor(inputConf.ramp*days2sec./(inputConf.EXTSTEP_SECONDS*inputConf.isplit)); % ramp over one day
0021 inputConf.START_DATE=datestr(inputConf.startDate,'yyyy-mm-dd HH:MM:SS');%           '2046-02-01 00:00:00';
0022 inputConf.END_DATE=datestr(inputConf.endDate,'yyyy-mm-dd HH:MM:SS');% '2046-03-01 00:00:00';
0023 inputConf.RST_FIRST_OUT=inputConf.START_DATE;
0024 % Change sigma file
0025 inputConf.IREPORT = floor(inputConf.report*60./(inputConf.timestep*inputConf.isplit));
0026 inputConf.BOTTOM_ROUGHNESS_FILE  = [inputConf.casename  '_z0=',num2str(inputConf.bed_roughness), '.nc'];
0027 inputConf.INPUT_DIR= inputConf.fvcom_input_nml;
0028 inputConf.OUTPUT_DIR = inputConf.fvcom_output_nml;
0029 
0030 inputConf.NC_FIRST_OUT=inputConf.START_DATE;
0031 inputConf.NCAV_FIRST_OUT=inputConf.START_DATE;
0032 inputConf.PROJECTION_REFERENCE=inputConf.projection;
0033 % if isfield(inputConf,'TS_nudge')
0034 %     inputConf.OBC_TEMP_NUDGING_TIMESCALE = 1/(inputConf.TS_nudge*3600/inputConf.timestep);
0035 %     inputConf.OBC_SALT_NUDGING_TIMESCALE = 1/(inputConf.TS_nudge*3600/inputConf.timestep);
0036 %     inputConf.OBC_FABM_NUDGING_TIMESCALE = 1/(inputConf.TS_nudge*3600/inputConf.timestep);
0037 % end
0038 
0039 
0040 
0041 [fmt,nml]=make_default_nml(inputConf);
0042 
0043 if isfield(inputConf,lower('OFFLINE_FABM_FILE'))
0044 else
0045     nml.NML_FABM = rmfield(nml.NML_FABM,'OFFLINE_FABM_FILE');
0046     
0047 end
0048 
0049 % get name of nml blocks
0050 nml_blocks=fieldnames(nml);
0051 nml_vars={};
0052 change_vars=fieldnames(inputConf);
0053 for nn=1:length(nml_blocks)
0054     nml_vars=fieldnames(nml.(nml_blocks{nn}));
0055     for vv=1:length(nml_vars)
0056         var_idx=strcmpi(nml_vars(vv),change_vars);
0057         if any(var_idx)
0058             
0059             change_field=upper(change_vars{find(var_idx)});
0060             disp(['Changing variable ',nml_blocks{nn},'.',change_field])
0061             nml.(nml_blocks{nn}).(change_field)=inputConf.(change_vars{find(var_idx)});
0062         end
0063     end
0064 end
0065 % % get name of nml blocks
0066 % nml_blocks=fieldnames(nml);
0067 % nml_vars={};
0068 % change_vars=fieldnames(change);
0069 % for nn=1:length(nml_blocks)
0070 %     nml_vars=fieldnames(nml.(nml_blocks{nn}));
0071 %     for vv=1:length(nml_vars)
0072 %         var_idx=strcmp(nml_vars(vv),change_vars);
0073 %         if any(var_idx)
0074 %             disp(['Changing variable ',nml_blocks{nn},'.',change_vars{find(var_idx)}])
0075 %             nml.(nml_blocks{nn}).(change_vars{find(var_idx)})=change.(change_vars{find(var_idx)});
0076 %         end
0077 %     end
0078 % end
0079 res = write_model_nml(inputConf,nml,fmt);
0080 assert(res == 0, 'Error writting namelist file %s', ...
0081     fullfile(inputConf.fvcom_model, sprintf('%s.nml', inputConf.casename)))
0082 % end
0083 % fprintf(
0084 %  &NML_CASE
0085 %  CASE_TITLE      = 'Nadoor Production FVCOM3.1.6 code'
0086 %  TIMEZONE        = 'UTC';%
0087 %  DATE_FORMAT     = 'YMD'
0088 %  DATE_REFERENCE  = 'default'
0089 %  START_DATE      = '2046-02-01 00:00:00'
0090 %  END_DATE        = '2046-03-01 00:00:00'
0091 % %/

Generated on Wed 20-Feb-2019 16:06:01 by m2html © 2005