U #g0@s0ddlmZGdddeZGdddeZdS)) makenwrapc@s,eZdZdZddZddZeddZdS) nmlz+!Class that generates the namelist for POM.cCsddddddddddd d d d d d d ddd ddddddd d ddd|_ddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1g|_d2S)3z*!nml constructor. Generates the namelist.z'MPIPOM-TC: stormenv'z 'stormenv'rg?-z'yyyy-mm-dd-hh:00:00 +00:00'z'restart.phaseN.nc'g@z 'restart'g?g@gffffff6@g@g!)title netcdf_filemodenadvniteraswnpgdteisplit time_start nread_rst read_rst_file write_rstwrite_rst_filedaysprtd1prtd2swtchnbctifplanecnorth_eismothsmhtnowinddigeovelnlionedimipwavenstormskppflagr r r r r rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&Nnamelistkeysselfr,5/lfs/h1/ops/prod/packages/hwrf.v13.2.9/ush/pom/nml.py__init__nspz nml.__init__cCs||jd<d|d|jd<||jd<||jd<||jd<||jd<||jd<||jd <| |jd <| |jd <| |jd <| |jd <| |jd<||jd<||jd<||jd<||jd<||jd<||jd<||jd<dS)ar!Updates the namelist values @param title Runs' title. @param netcdf_file POM NetCDF output file (run ID) @param time_start Model analysis time in format "YYYY-MM-DD HH:MM:SS <+/->HH:MM" where the "<+/->HH:MM" is the timezone. @param nread_rst index index to indicate whether run to start from restart file (nread_rst=0: no restart input file; nread_rst=1: restart input file) @param read_rst_file restart input filename @param write_rst Restart interval. @param days Run duration (days) @param prtd1 Initial print interval (days) @param nbct Surface temperature boundary condition (see initialize.f) @param tnowindd No prescribed wind after tnowindd (days) @param igeovel Initial geostrophic velocity option. 0=no, 1=yes @param nl Number of Z levels in initial condition files.r "r rrrrrrrrrrrr r!r"r#r$r%r&Nr()r+r r rrrrrrrrrrrr r!r"r#r$r%r&r,r,r-__call__s(                  z nml.__call__cCsdS)zd!Writes the POM namelist pom.nml in the destination directory. @param DEST destination directoryNr,)r+DESTr,r,r-makesznml.makeN)__name__ __module__ __qualname____doc__r.r1rr3r,r,r,r-rls ,)rc@s(eZdZdZddZddZddZdS) kppnmlz/!Class that generates the namelist for POM KPP.cCsRddddddddddddddddd|_ddd d d d d dddddddddg|_dS)z1!kppnml constructor. Generates the kpp namelist.z.true.z.false.gHz>g$@gGz?) kpp_lt_logkpp_lagrangian_logkpp_sig_match_sbl_logkpp_sig_match_bbl_log kpp_sbl_log kpp_int_log kpp_bbl_logkpp_std_out_logkpp_heatflux_log use_kpp_k_logkpp_sbl_ek_lim_log min_kpp_kh min_kpp_km max_kpp_kh max_kpp_kmkpp_ricr9r:r;r<r=r>r?r@rArBrCrDrErFrGrHNr'r*r,r,r-r.s>zkppnml.__init__cCs||jd<||jd<dS)z!Updates the namelist values @param kpp_lt_log True to enable Langmuir turbulence enhancement @param kpp_ric Critical Richardson number in KPP r9rHNr0)r+r9rHr,r,r-r1s zkppnml.__call__c Cs|d}d}t|d`}d}|d|tt|jD]*}|d|j|||j|j|fq8|ddW5QRXdS) zh!Writes the POM KPP namelist kpp.nml in the destination directory. @param DEST destination directoryz/kpp.nmlz = zw+z&kpp_nmlz%s z %s %s %s /N)openwriterangelenr)r()r+r2filenameasgnfileargkr,r,r-r3s  z kppnml.makeN)r4r5r6r7r.r1r3r,r,r,r-r8sr8N)utilrobjectrr8r,r,r,r-s h]