U #g2 @sdddddddddd d g Zd d lZd d lZd d lZd d lZd d lZd d lZd d lZd d l Zd d lm Z d dlm Z d dlm Z mZmZmZmZd dlmZmZmZmZmZmZddlmZmZmZddlTddlmZddlm Z m!Z!m"Z"m#Z#ddl$m%Z%m&Z&d dl'm(Z(ddddZ)Gddde*Z+Gddde+Z,dZ-Gddde,Z.Gd dde,Z/Gd!dde,Z0Gd"dde,Z1Gd#dde,Z2Gd$dde,Z3Gd%ddZ4Gd&d d Z5Gd'd d Z6d S)(HwrfOceaninifbtrg3nartsst_pertphasepgetprunpsendN)join)NamedDir) deliver_filemakedirs make_symlinkrmall isnonempty)mpimpiruncheckrunrunexeopenmp) ysplitterinpfilelogi2int)*) LCUsefullness)read_rtofs_infileadd_afile_infileprep_rtofs_infile get_rtofs_kdm) get_vitals track_shorten)set_ecflow_label123)GDEMGDEM3ZLEVITc@seZdZdZddZdS)rzp!Abstract base class that stores data relating to the HWRF workflow in which the POM initialization resides.c Csd||_||_||_||_||_d|dg|_||_| |_||_ |j ddksTt | |_ | |_ dS)a!Hwrf constructor @param STORMNAME Upper-case storm name for filenames (KATRINA) @param STORMID Three character storm number and basin, upper-case (12L) @param STARTDATE Simulation analysis time as a string, YYYYMMDDHH (2005082918) @param EXEChwrf Directory with HWRF executables. @param PARMhwrf Directory with HWRF parameter files. @param FIXhwrf Directory with HWRF fixed files. @param LCDIR Directory with loop current files @param GFSDIR Directory with input files from GFS. @param CSTREAM Directory to place files for the POM forecast to read. @param COMIN HWRF final output directory.z/pom pom/outputr N) multistorm STORMNAMESTORMID STARTDATEEXEChwrfr PARMhwrfLCDIRGFSDIRFIXhwrffindAssertionErrorCSTREAMCOMIN) selfr.r/r0r1r2r3r6r4r5r9r:r<6/lfs/h1/ops/prod/packages/hwrf.v13.2.9/ush/pom/init.py__init__*s z Hwrf.__init__N)__name__ __module__ __qualname____doc__r>r<r<r<r=r'scs*eZdZdZfddZdddZZS)rz,!Parent class of POM initialization classes.c s~|ddksttt|||| | | | | |||| ||_||_||_||_||_ ||_ | dd|_ |j ddd|_dS)a5!Oceanini constructor @param ODIR Ocean output directory in CSTREAM @param SSTASIM SST ASIM flag, True or False @param DOMAIN Ocean domain. @param ODATA Type of ocean data. @param STORMNAME Upper-case storm name for filenames (KATRINA) @param STORMID Three character storm number and basin, upper-case (12L) @param STARTDATE Simulation analysis time as a string, YYYYMMDDHH (2005082918) @param EXEChwrf Directory with HWRF executables. @param PARMhwrf Directory with HWRF parameter files. @param FIXhwrf Directory with HWRF fixed files. @param LCDIR Directory with loop current files @param GFSDIR Directory with input files from GFS. @param CSTREAM Directory to place files for the POM forecast to read. @param COMIN HWRF final output directory. @param kwargs Can optionally contain conf, which should point to a ConfigParser-like object to use for configuration information. An hwrf.config.HWRFConfig is acceptable for this.r-r confNpom gfssst_type)r7r8superrr>ODIRDOMAINODATASSTASIMINDATAPHY1DpoprCgetintrE)r;rHrIrJrKrLrMr.r/r0r1r2r3r6r4r5r9r:kwargs __class__r<r=r>ds zOceanini.__init__r,cCs|jd|j}z^|dkrJtj|rJtj|d|sJt|d|tj|s^t|||d|fWSdt}t|YnXdS)z!Creates the ocean run path, whose subdirectory is SUBDIR. @param SUBDIR the subdirectory to create @returns a tuple (rundir,finaldir) where rundir is CSTREAM+'/'+ODIR and finaldir is the SUBDIR subdirectory of that /r,z%s: CSTREAM does NOT existN)r9rHospathexistsrIOError)r;ZSUBDIRZRUNDIRmsgr<r<r=setpaths zOceanini.setpath)r,)r?r@rArBr>rY __classcell__r<r<rQr=rbs 1aThe loop current files are unusable. I will fall back to climatology loop current files that are stored in the HWRF parm directory. Please check the NHC save areas and HWRF script logic. The check_lcfiles says this: ------------------------------------------------------------------ %s ------------------------------------------------------------------ Note that off-season storms may be in this situation as a regular course of operations since NHC and URI do not update the loop current files off season. That is especially true if the storms are all far from the Loop Current. In such situations, climatology loop current is acceptable. cs4eZdZdZfddZd ddZd ddZZS) rz>!Runs the FBTR (feature-based) initialization of the MPIPOMTC.cstt|j||dS)zI!fbtr constructor @param args,kargs passed to Oceanini.__init__()N)rGrr>r;argskargsrQr<r=r>sz fbtr.__init__Nc Cs6|dkrtd}t|j\}}}}}z|jdkrvtt|jd|dt|dd|dtt|d d |||g|d|jd krtt|jd|d t|dd|d|jd krtt|jd|d t|dd|dtt|jd|dt|dd|d|jdkrJtt|jd|dt|dd|dtt|d d |||g|dtt|j dt|dd|dtt|j d|dt|dd|dtt|j d|dt|dd|dtt|j d|t|dd|dtt|j d|t|dd|dtt|j d|t|dd|dtt|j dt|dd|dtt|j d t|d!d|dtt|j d"t|d#d|dt|j d$|||}t|j d%|||} t |j|| |d} | t | rt|t|d&d|dt| t|d'd|dnr|jd(d)d*} | d+krtd,n| d-kr,td,tt|jd.t|d&d|dtt|jd/t|d'd|dtt|d0||g|dtt|d1t|jg|dtt|d2|j|j|j|jg|dWnnttfk r} zW5d} ~ XYnFtk r0} z&d3t| }|j|dd4t|W5d} ~ XYnXdS)5z!Links or copies input files. @param DEST The directory in which to link or copy files. @param logger A logging.Logger for log messages.NrDrgfs.tz.pgrb2.0p25.f000fort.11Tloggergribinfo000z.sfcanlrFz.sanlfort.12z.pgrb2.pgbm.f000zgfdl_ocean_topo_and_mask.unitedfort.66z gfdl_gdem.z.asciizfort.8zfort.90zgfdl_ocean_readu.dat.zfort.24zgfdl_ocean_spinup_gdem3.dat.zfort.82zgfdl_ocean_spinup_gspath.zfort.50zgfdl_ocean_spinup.BAYufzfort.55zgfdl_ocean_spinup.FSgsufzfort.65zgfdl_ocean_spinup.SGYREufzfort.75z hwrf_gfdl_loop_current_rmy5.dat.z(hwrf_gfdl_loop_current_wc_ring_rmy5.dat.fort.31fort.32failure loop_currentnoneunexpected_failureQLoop current unusable and loop current is required due to a failure test setting.expected_failurezhwrf_gfdl_loop_current_rmy5.datz'hwrf_gfdl_loop_current_wc_ring_rmy5.datzfort.91 input_sharpinputzCannot find input: exc_info)logging getLoggerrr1rErjn2rr5rr6r4rrboolrCgetstrUnexpectedPOMFailureTestExpectedPOMFailureTestr3ocn_climrLrJrMrKr/ Exceptionstrwarning POMInputError)r;DESTrby4mmmm1ddhhZlfileZrfileZuseful require_loopeeerXr<r<r=getinps  & & && &             z fbtr.getinpc Cst|}tdd||dkr*td}t|j\}}}}}tt|dt|dt|d|dtt|d t|d t|d |dtj t|d r>t d d} t t j} | | W5QRXt j|t jjd|dd|jdks|jdkr6|jd} t|d} tt| d| k|d} |d||jd} t|d} t jj|d0ttt| ddjdd|j| k|d} W5QRX|d| | dkrtj t|drtt|dt|d dtt|dt|d d|d |n>d!t|d tt|d | f}||tdd"|t |n&d#|}|!|tdd$|t"|t#d%rxt#d&rxtt|d't|d(||d|jd)} t|d*}t|d+} tt| |k| k|d} |d,| | dkr8tj t|d'r8tt|d't|d(|d|d|d-| tdd.|n>tt|j$d/|t|d(||d|d0| tdd1|nttt|j$d/|t|d(||d|j%d2d3d4}|d5krt&d6n|d7krt'd6|(d8| tdd9|tj t|d(|rt)|d:||d;d|d|jd<} t|d=} tt| | k|d} | dkrtj t|d>rtt|d>t|d?|j*d@|d|d|dA| n(dB| }tddC|||t+|n|dDd(|tj t|d?|j*d@|rPtt|d t|dEd|dtt|d t|dFd|dtt|d'|dt)t|d?|j*d@|t|d'd|dt)t|j$dG|j*dHt|dId|d|jdJ|j,ddK} t|dL}t|dM} tt| |k| k|d} | dkr&tj t||j-dNr&|dO|j,W5QRdSdP|j,}tddQ|||t.|n6dDdR/d?|j*d@|g}tddS|||t.|W5QRXdS)Tz!Runs the FBTR initialization @param DEST the destination directory in which to run and generate output. @param logger a logging.Logger for log messagesmethodz feature-basedNrDfort.23fort.74fort.77ra lonlat.gfs sst.gfs.dat mask.gfs.datr`listingwbT ZAignorerbstackrri grb2index grb2index.outr`zfort.99GRIB index file Created: {0} hwrf_getsst getsst.outthreads128M OMP_STACKSIZEhwrf_getsst: err = %sr FGFS SST extracted: {0}?hwrf_getsst Failed: NO GFS SST extracted from %s, => %s, err=%s7Feature-based hwrf_getsst FAILED - revert to uncoupled.)GFS Files Containing SST NOT Found in %s:=Feature-based missing GFS data; FAILED - revert to uncoupled.rlrmzfort.13zgfdl_initdata.united.Zhwrf_sharp_mcs_rf_l2m_rmy5rtzsharp_mcs_r_l2b.outzsharp_mcs_rf: err = %szSpecified LC penetration: {0}z&feature-based with recent loop currentzgfdl_initdata.gdem.united.z.sharp_mcs_rf failed: Climate LC penetration %sz.climatology loop current (sharp_mcs_rf failed)rnrorprqrrrsz0LC data NOT available: Climate LC penetration %sz/climatology loop current (loop data is missing)z/gfdl_initdata.united.z/fort.13Zhwrf_ocean_transatl06prepztransatl06prep.outzfort.113zgfdl_initdata..ztransatl06prep: Success {0}ztransatl06prep: Failed {0}z@Feature-based ocean_transatl06prep FAILED - revert to uncoupled.zNOT Found in %s:fort.21fort.22gfdl_ocean_topo_and_mask..loresrkhwrf_ocean_pomprep_reruocean_pomprep.out.grid.ncocean_pomprep: Success %s:zocean_pomprep: Failed %sz9Feature-based ocean_pomprep FAILED - revert to uncoupled.r,z:Feature-based init missing fix file - revert to uncoupled.)0rr&rxryrr1rrzrTrUrVopenrprodutilrListingwriterusage getrlimit setrlimitrErCgetexerrinfoformatrenvrreadlinkr POMSSTErrorerrorrrr6r|r}r~criticalrrIZ POMPrepErrorrJr/ POMInitFailedr )r;rrbdrrrrrfrxclogretcoderXinprr<r<r=setruns   ""                        *    "*  $      z fbtr.setrun)N)Nr?r@rArBr>rrrZr<r<rQr=rs  Dcs4eZdZdZfddZd ddZd ddZZS) rz$!Runs the G3 initialization for POM.cstt|j||dS)zY!g3 constructor @param args,kargs All arguments are passed to Oceanini.__init__()N)rGrr>r[rQr<r=r>usz g3.__init__Nc Cs>|dkrtd}t|j\}}}}}z|jdkrvtt|jd|dt|dd|dtt|d d |||g|d|jd krtt|jd|d t|dd|d|jd krtt|jd|d t|dd|dtt|jd|dt|dd|d|jdkrJtt|jd|dt|dd|dtt|d d |||g|dtt|j d|j dt|dd|dtt|j d|dt|dd|dtt|j d|dt|dd|dtt|d|j |j |j |jg|dWnTtk r8}z4dt|f} |j| ddtdd|t| W5d}~XYnXdS)z!Links all required input files. @param DEST directory in which to link inputs. @param logger a logging.Logger for log messagesNrDrr^r_r`TrarcrdrerfrFrgrhrirjrrrkZtgdemv3sz.ncztin.ncZsgdemv3szsin.ncruzInput Data does NOT exist: %srvrz5GDEM init missing data; FAILED - revert to uncoupled.)rxryrr1rErrzr5rr6rIrJrMrKr/rrrr&r r;rrbrrrrrrrXr<r<r=rysV  & & && &    z g3.getinpc Cs4t| tdd||dkr*td}t|j\}}}}}tt|dt|dt|d|dtt|d t|d t|d |dtj t|d rt j |t j jd |dd|jdks|jdkr|jd}t|d} tt|d| k|d} |d||jd}t|d} t j j |d0ttt|ddjdd|j| k|d} W5QRX|d| | dkrtj t|drtt|dt|d d|dtt|dt|d d|d|d| n>dt|d tt|d | f} || tdd |t| n&d!|} || tdd"|t| tt|d t|d#d|dtt|d t|d$d|d|jd%|jdd&}t|d'} t|d(} tt|| k| k|d} | dkrtj t||jd)rtd*|jW5QRd Sd+|j} tdd,||| t| W5QRXdS)-z!Runs the g3 ocean initialization @param DEST directory in which to run @param logger a logging.Logger for log messagesrzGDEM climatologyNrDrrrrarrrr`Trrrrirrrrrrrrrrr Frrrrrrrrrerurrrocean_pomprep: Failed %s:z-GDEM ocean_init FAILED - revert to uncoupled.) rr&rxryrr1rrzrTrUrVrrrrrErCrrrrrrrrrrrrrJr/r r;rrbrrrrrrrrrXrr<r<r=rsb   ""             $   z g3.setrun)N)Nrr<r<rQr=rss  cs4eZdZdZfddZd ddZd ddZZS) rz+!Runs the na (NCODA) initialization of POM.cstt|j||dSzU!na Constructor @param args,kargs All arguments passed to Oceanini.__init__()N)rGrr>r[rQr<r=r>sz na.__init__Nc Cs|dkrtd}t|j\}}}}}z"|jdkrvtt|jd|dt|dd|dtt|d d |||g|d|jd krtt|jd|d t|dd|d|jd krtt|jd|d t|dd|dtt|jd|dt|dd|d|jdkrJtt|jd|dt|dd|dtt|d d |||g|dtt|j d|j dt|dd|dtttd|||dt|dd|dtttd|||dt|dd|dtt|j dt|dd|dtt|j dt|dd|dtt|j dt|dd|dtt|d |j |j |j |jg|dWnHtk r}z(d!t|f} |j| dd"t| W5d}~XYnXdS)#!Obtains all input files, linking or copying them. @param DEST Directory in which to link files. @param logger a logging.Logger for log messagesNrDrr^r_r`TrarcrdrerfrFrgrhrirjrrrkZ%seatmp_pre_000000_005000_1o2161x1051_Z00_00000000_analfldzfort.48Z%salint_pre_000000_005000_1o2161x1051_zfort.49Z,depths_sfc_000000_000000_1o2161x1051_datafldzfort.68Z,grdlon_sfc_000000_000000_1o2161x1051_datafldzfort.78Z,grdlat_sfc_000000_000000_1o2161x1051_datafldzfort.79ruInput data does NOT exist: %srv)rxryrr1rErrzr5rr6rIrJrMrKr/rrrrrr<r<r=rs  & & && &      z na.getinpc Cst|tdd||dkr*td}t|j\}}}}}tt|dt|dt|d|dtt|d t|d t|d |dtj t|d rt j |t j jd |dd|jdks|jdkr|jd}t|d} tt|d| k|d} |d||jd}t|d} tt|jdd|j| k|d} td| | dkrtj t|drtt|dt|d d|dtt|dt|d d|d|d| n2dt|d tt|d | f} || t| n&d|} || tdd |t| tt|d t|d!d|dtt|d t|d"d|d|jd#|jdd$}t|d%} t|d&} tt|| k| k|d} | dkrtj t||jd'rtd(|jW5QRd Stdd)|d*|j} || t| W5QRXdS)+!Runs the na initialization. @param DEST directory in which to run. @param logger a logging.Logger for log messages.rzNCODA initializationNrDrrrrarrrr`Trrrrirrrrrrrrrr Frrrrrrrrerurrrz.NCODA ocean_init FAILED - revert to uncoupled.r)rr&rxryrr1rrzrTrUrVrrrrrErCrrrrrrrrrrrrJr/rrr<r<r=rs^   ""            $   z na.setrun)N)Nrr<r<rQr=rs  %cs>eZdZdZfddZd ddZd ddZd d d ZZS)rz*!Runs the rt (RTOF) initialization of POM.cstt|j||dSr)rGrr>r[rQr<r=r>/sz rt.__init__Nc Cs|dkrtd}t|j\}}}}}|jj}|jdkr>|jn|jd} |j} ||zL|dkrt t |j dt |dd|dt t |j d t |d d|dt t |j d } nt t |j d d |d gt |d d |d gd|dt t |j d d |d gt |d d |d gd|dt t |j d |d } | dkrNt |jd} nP| dkrft |jd} n8d| tf} |j| ddtddt| f|t| t t | dt |dd|dt t | dt |dd|dt t | dt |dd|dt t | dt |dd|dt|jdkrl|jdkrlt t |j d |d!t |d"d|dtt |d#d$|||g|dt|jdkr|jd%krt t |j d |d&t |d"d|dt|jdkr|jd'krt t |j d |d&t |d"d|dt t |j d |d(t |d)d|dt|jdkrt|jd*krtt t |j d |d+t |d"d|dtt |d#d$|||g|dtt |d,|j|j|j|jd-| d-| g|dWnTtk r}z4d.t|f} |j| ddtdd/|t| W5d}~XYnXdS)0rNrDggv@00rtofs_glo.t00z.n00.archv.aTrartofs_glo.t00z.n00.archv.br,rtofs_glo.t00z.f.archv.a.archv.b z../rtofs-navy-32/)z../rtofs-navy-41/zWrong kdm %d from %srvrz@RTOFS init FAILED (%s levels unrecognized) - revert to uncoupledz&./rtofs_glo.navy_0.08.regional.depth.aregional.depth.az&./rtofs_glo.navy_0.08.regional.depth.bzregional.depth.bz%./rtofs_glo.navy_0.08.regional.grid.aregional.grid.az%./rtofs_glo.navy_0.08.regional.grid.bzregional.grid.br rr^r_r`rcrdrerfrFrgrhrirjruz%.6frzdt|dt t|d| f} || tdd|t| n&d |} tdd!||| t| t |j dkrttt|d t|d"d|dtt|d t|d#d|d|jd$}t|d%} t|d&} tt|| k| k|d} | dkrLt jt|d'rLtt|d't|d(d|dtt|d)t|d*d|dtt|d+t|d,d|dtt|d-t|d.d|d|d/| n&d0|} || tdd1|t| tt|d%} | dkrd2} || tdd3|t| | d4}| d5}|jd6}t jt|d7st|d8} } tt|d9||d7f| k} t jt|d7r$| dkrFd:} || tdd;|t| t jt|d<svtt|d=||d|t| |jd?kr|jd@|j ddA}n|jdB|j ddA}t|dC} t|dD} tt|| k| k|d} | dkrrt jt||j!dErrtdF|j tddG|W5QRd SdH|j } tddI||| t"| W5QRXdS)Jrrz RTOFS initialization starting...NrDrrrrarrrTg _Brr r`rrirrrrrrrrrFrrz0RTOFS init gfs_sst FAILED - revert to uncoupled.rz:RTOFS init GFS data missing; FAILED - revert to uncoupled.rrZhwrf_pom_archv2data3zrzarchv2data3z.outzfort.40z temprtf.datzfort.41z salnrtf.datzfort.42z uwndrtf.datzfort.43z vwndrtf.datz#archv2data3z outputs delivered: {0}z0No fort.40 (archv2data3z) Files NOT Found in %s:z5RTOFS init archv2data3z FAILED - revert to uncoupled.z!Return of read_rtofs_infile emptyz:RTOFS init read_rtofs-infile FAILED - revert to uncoupled.idmjdmZhwrf_pom_hycom2rawz lonlatrtf.datz hycom2raw.outrz3 hycom2raw Failed and lonlatrtf.dat does not exist z;RTOFS init fix files missing; FAILED - revert to uncoupled.z depthrtf.datrz-RTOFS hycom2raw FAILED - revert to uncoupled.yesZhwrf_ocean_pomprep_bs_rerrurrrzRTOFS initialization SUCCESS!rz2RTOFS initialization FAILED - revert to uncoupled.)#rr&rxryrr1rrzrrrrrKrTrUrVrrErCrrrrrrrrrrrr r.rJr/r)r;rrbrrrrrrrrrXrZdimsrrr<r<r=r|s   ""                           $    z rt.setrun)N)N)N) r?r@rArBr>rrrrZr<r<rQr=r-s   ; cs4eZdZdZfddZd ddZd ddZZS) rz#!Runs the sst perturbation for POM.c s<tt|j||||||||| | | | | |||f|||_dS)z_!sst_pert constructor @param args,kargs All arguments are passed to Oceanini.__init__()N)rGrr> SST_PERT_SEED)r;rHrIrJrKrLrMr/r0r1r2r3r6r4r5r9r:rr]rQr<r=r>szsst_pert.__init__Nc Cs|dkrtd}zt|j\}}}}}|jdkrZtt|jd|dt|dd|dn0|jd krtt|jd|d t|dd|dtt|d |j |j|j g|dWnRt k r}z4d t |f} |j | dd tdd|t| W5d}~XYnXdS)z!Links or copies input files. @param DEST The directory in which to link or copy files. @param logger A logging.Logger for log messages.NrDtransatlZ sst_clim_z_al.ncz sst_clim.ncTraeastpacz_ep.nc input_pertrrvrzAsst_pert init missing input data; FAILED - revert to unperturbed.)rxryrr1rIrrzr6rr/rrrrr&rrr<r<r=rs  ( &$ zsst_pert.getinpc Cst|tdd||dkr(td}tdd}|}|jd|dd }t |d }t |d }t t ||k|k|d }|dkrt j t |d rtd |jW5QRW5QRdSd|j} tdd||| t| W5QRXW5QRXdS)z!Runs the sst perturbation @param DEST directory in which to run @param logger a logging.Logger for log messagesrzsst-perturbationNrDrurZhwrf_sst_pert_r rerz sst_pert.outrazsst_pert: Success %s:Tzsst_pert: Failed %s:z5GDEM sst perturbation FAILED - revert to unperturbed.)rr&rxryrreadlinestriprCrrzrrrTrUrVrrJrr) r;rrbrdatarrrrrXr<r<r=rs"          zsst_pert.setrun)N)Nrr<r<rQr=rs cs>eZdZdZfddZd ddZd ddZd d d ZZS)rzX!Runs a later phase of the ocean init to add additional features such as cold wakes.cs"tt|j||||_||_dS)z\!phase constructor @param args,kargs All arguments are passed to Oceanini.__init__()N)rGrr>nproc_inproc_j)r;rrr\r]rQr<r=r>szphase.__init__Nc Cst|dkrtd}zt|j\}}}}}t|j|j}tt||jdt||jdd|dtt||jdt||jdd|dtt||jdt||jdd|dtt||jdt||jdd|dtt||jd t||jd d|dt t|d t |j t |j g|dWnHt k rn} z(d t | f} |j| dd t| W5d} ~ XYnXdS) z!Links all input data. @param DEST Directory in which to link files. @param logger a logging.Logger for log messagesNrDrTraz.ts_initial.ncz .ts_clim.ncz.uv_initial.ncz.el_initial.ncpom_proc_countzInput data does not exist: %srv)rxryrr1rzr9rHrr/rrrrrrr) r;rrbrrrrrSRCrrXr<r<r=rsF (z phase.getinpc CsDt|0|dkrtd}t|j\}}}}}tjt||j drtjt|dr|j dkrx|j d}n |j d}t|d} |j |j} ttt|| | k|d } |d | | d krtjt|d r|d |W5QRdSd|} || W5QRdSnd|} || t| W5QRXdS)z!Runs the phase initialization @param DEST The directory in which to run. @param logger A logging.Logger for log messages.NrDrzpom.nmlrZhwrf_ocean_bs_initZhwrf_ocean_initzocean_init.outrazhwrf_ocean_init: err = %sr zrestart.0001.nczPhase completed HERE: %sTzPhase FAILED HERE: %sFzInput Files NOT exists %s:)rrxryrr1rTrUrVrzr/r.rCrrrrrrrrrr) r;rrbrrrrrrrZtasksrrXr<r<r=r5s.        z phase.setruncCsb|dkrtd}tjt||rDtt||t||d|ddSd|}||t|dS)a\!Delivers an output file using produtil.fileop.deliver_file() @param SRC Directory with the input file. @param infile Basename of the input file inside of SRC @param DEST Destination directory of the file @param outfile Name of the file in the DEST directory. @param logger A logging.Logger for log messages.NrDFraTzRestart file %s does NOT exist:) rxryrTrUrVrzrrr)r;rrroutfilerbrXr<r<r=sendoutQs  z phase.sendout)N)N)N) r?r@rArBr>rrrrZr<r<rQr=rs    c@seZdZdZdddZdS)r z(!Utility class for obtaining input data.NcCs>|dkrtd}|dt|t|f|j||ddS)z!Asks "this" to deliver its input by calling this.getinp(...) @param this an Oceanini object @param DEST directory in which to make links @param logger a logging.Logger for messagesNrDzget input this=%s DEST=%sra)rxryrrrr;thisrrbr<r<r=rcs z pget.getinp)N)r?r@rArBrr<r<r<r=r asc@seZdZdZdddZdS)r zC!Utility class for executing ocean initialization setrun functions.NcCs |dkrtd}|j||dS)z!Runs this.setrun(...) to run the ocean initialization @param this an Oceanini object @param DEST the directory in which to run @param logger a logging.Logger for log messagesNrDra)rxryrrr<r<r=rms z prun.setrun)N)r?r@rArBrr<r<r<r=r ksc@seZdZdZdddZdS)r z.!Utility class for delivering Oceanini output.NcCs&|dkrtd}|j|||||dS)aV!Calls this.sendout(...) @param this An Oceanini object. @param SRC the directory from which to copy @param infile the input file basename of the file in SRC @param DEST the destination directory @param outfile the name of the output file in DEST @param logger a logging.Logger for log messagesNrDra)rxryr)r;rrrrrrbr<r<r=rvs z psend.sendout)N)r?r@rArBrr<r<r<r=r ts)7__all__rTrxshutilos.path produtil.runrprodutil.fileop produtil.cdprodutil.rusager rzrrrrrrrrrrrrutilrrr exceptionsZ check_lcfilesrrr r!r"r#trackr$r%produtil.ecflowr&robjectrrZ lc_oper_inforrrrrrr r r r<r<r<r=s>       ;E;[_35M