U $g @sdZddddgZddlZddlZddlZddlZddlZddlZddl Zddl Z ddl Z ddl Z ddlZ ddlZ ddlZ ddlZ ddlZ ddlmZmZmZmZmZddlmZmZmZdd lmZmZdd lmZmZmZm Z m!Z!m"Z"m#Z#m$Z$dd l m%Z%m&Z&m'Z'm(Z(dd lm)Z)m*Z*d dddddZ+Gddde j,j-Z.Gddde j/j0Z1d/ddZ2d0ddZ3Gddde j/j4Z5dd Z6Gd!dde j7j8Z9Gd"dde j:j;ZdS)1z8This module handles WW3 related scripts for HWRF system.WW3Init WRFWW3POMWW3Post WRFWW3HYCOMN) FileProductRUNNING COMPLETEDFAILED UpstreamFile) make_symlink deliver_filewait_for_files)NamedDirTempDir)mpimpirunrunrunstrcheckrunexebigexealias) to_datetimeto_datetime_rel to_fraction to_timedelta)WaveInitFailed WW3InputError) ./mod_def.ww3z{com}/{out_prefix}.mod_def.ww3)z ./wind.ww3z{com}/{out_prefix}.wind.ww3)z ./current.ww3z{com}/{out_prefix}.current.ww3)z ./restart.ww3z#{com}/{out_prefix}.restart_init.ww3)z./ww3_shel.inpz{com}/{out_prefix}.ww3_shel.inp)Zmod_defwindcurrentrestartww3_shelcspeZdZdfdd ZddZddd Zd d Zd d ZddZddZ ddZ ddZ ddZ ddZ ZS)rN~`Tc  sTtt|j|||fd|i| |t||_t||_t||_t||_ dS)aCreates a WW3Init dstore - the produtil.datastore.Datastore to use conf - the HWRFConfig to use section - the section name for this task taskname - the task name. Default: section fcstlen - the forecast length in hours outstep - the output step in seconds pntstep - the pntout step in seconds rststep - the restart output step in seconds Other keyword arguments are passed to the superclass constructor.tasknameN) superr__init___make_productsfloatfcstlenintoutsteppntsteprststep) selfdstoreconfsectionr%r*r,r-r.kwargs __class__6/lfs/h1/ops/prod/packages/hwrf.v13.2.9/ush/hwrf/ww3.pyr's    zWW3Init.__init__c Cst|_tj|jj}|dd}|dkr4dtd<|j Zt D]J\}}|\}}t j |j ||j}|||||_||d<||f|j|<qHW5QRXdS)zCreates FileProduct objects for all output files. The outdir is the directory to which the WW3 package output its final files.ww3_bdynoyes)z ./nest.ww3z{com}/{out_prefix}.nest.ww3nest localpathN)dict _productshwrfnumericsrr1cycleconfstr prodnamesr0 transactionitemsprodutil datastorerr%timestrlocation)r/atimer8prodname filepathsr<compathprodr6r6r7r(,s   zWW3Init._make_productscks8|jD](\}}|\}}|dks,||jkr |Vq dSzIterate over all products.Nr>rErK)r/namer3rKstuffrNr<r6r6r7products>szWW3Init.productsc cs`t|jj}td|j|}t|dd}|dd}|dd}t|d}t||}|}||krt |j ||||dVt||}q^|d d } | d krt|jj}td |} |d d}|dd}| }t |j ||||ddV|dd } t d| | d ks| dkr\t|jj}td |} |dd}|dd}| }t |j ||||ddVdS)N input_stepr$ gfs_datasetgfsgfs_item datasetitemftimerJr8r9r:頫gfswave_datasetgfswave ww3bdy_item ww3bdy_ibpT)r[r\r]rJoptionalww3_rstz ww3_rst=%salwaysgdaswave_datasetgdaswave ww3rst_itemww3rst_gnh_10m) rr1rArr*rconfintrBrr=taskvarsprint) r/rJetimeintervalr[r\epsilonendewhenr8wtimerdr6r6r7 inputiterEs8                 zWW3Init.inputiterccsJ|}t|jj}t|jd|}t|dd}|dd}|dd}|dd}t j |j||}t |d } t| |} |} d } |d d} |d d }|dd}|dd}| | krF|j f||| |d|j}|jr(t|g|| |||d}|s(d||f}||t j||V| |d} t|| } qdS)NrTrUr$rVrWrXcataloghwrfdatarYr max_grib_waitgrib_sleep_time min_grib_size min_grib_agerZ)maxwait sleeptimemin_size min_mtime_agez3%s: did not exist or was too small after %d seconds)logrr1rArr*rrjrBr?input DataCatalogrlocaterkrealtimer error exceptionsr)r/loggerrJrmrnr[r\hddcrorprqfhourr}r~rrthefilewaitedmsgr6r6r7 gfsgrib2iteresJ             zWW3Init.gfsgrib2itercCs8|}|jD] \}}|\}}|j|d|dqdS)NF)frominfokeepr)rr>rEdeliver)r/rrKrRrNr<r6r6r7deliver_productsszWW3Init.deliver_productsc"s$|d}|dd}|dkr&d}n&|dkr4d}nd|fd}d}|dd}|dd}zlt|_|d d}t|j|j dd 2}fd d }t | d ddd|| dd|dkr|| d| dn|| dd|| dd|| ddt d} |r,| dk} t | d|dkrd} tjj| dtt| dd} |D]n} d| d} t| | ddD]} td| r| | 7} q| | dd d!| f| >}t |dqrtj| rd}nd}tjjd"| f|r^t | d#d$dd|| d%d%t d&} |rP| d'k} t | dnHt | d(d)dd|| d*d*t d+} |r| d,k} t | d|rt | d-d$dd|| d%d%t d&} |r| d.k} t | dn d/d}d0}z\| d1}tj|rNtjj |d2dd}tjjd3|fntjjd4|fWnBtk r}z"tjjjd5|t|fdd6W5d7}~XYnX|s|dks|d8krz td9dd}d:td;ddddt d} |r2| dk} t | dt d?d@dddAt| dBdBdd=|| t dC} |r| dDk} t | dt dEdFddW5QRXtjd2rd}Wn6tk r}ztjjjdGdd6W5d7}~XYnX|s`dHt | dIdJdd|| dKdKt dL} |rT| dMk} t | d|dkrz^dN|!t | dOdPdd|| dQdQt dR} |r| dSk} t | dWnPtk r}z0|j"#dTd7t$#dTd7tjjjdUdd6W5d7}~XYnX|r(|%t&j'(|j)|j*}| dV}t+|j)j,}t-|j.dW|}t/|j0}t/|j1}|dXkr| dY}t2|dZ}|3d7d[}W5QRXn.|dXkrd\}nd]|fdX}dX|_4d\}|j)5d^d_d`}t-|dWda|}t6}|j7|8db|8db|8db|8dbt/||8db|8dbt/|||8db|8dbt/|j9dc t2|ddB}t2dedf,} | :|j;|f|d|j)j,dg|W5QRXW5QRX|<W5QRXt=|_WnLtk r}!z,jdht|!fdd6t>|_|%W5d7}!~!XYnXd7S)izRuns the WW3 initializationT usegfswindr:Fr9zIWrong usegfswind value: %s. Assume usegfswind=yes.Set dummywind to False.r8rdredirectrrrm_firstcst||dddS)NTforcer)r )strr6r7linkszWW3Init.run..linkz {grid_inp}z ww3_grid.inprrz {grid_bot}.z {grid_msk2}z./ww3_grid_{vit[basin1lc]}.mskz {grid_msk}z {grid_obr}Zww3_gridz ./ww3_grid ww3_grid.logrzgfs.uvgrd10m.ncwgrib2zExtracting wind at 10 m from %sz:[UV]GRD:10 m above ground:z-iz-appendz-netcdfzpoprC _copy_logr?namelistNamelistInserterr1r2rrArr*r+r,r-openreadZpntoutgetfloatr=updatestrftimer.writeparserrr )"r/Z dummycurrrZ dummywindr8rdrdrcmdZncfilefsubsetlinerunmeZ have_restartZoldrsteenameddirniZshel_inprJrmZflddtpntdtZbuoy_inpbfZbuoyfileciZretimeinvarsnfofer6rr7rs                                   z WW3Init.runcCs@|}dD].}|jd|d}tj|r t||d|dq dS)N)rrrrww3_untarbdy.logrz{com}/{out_prefix}.{lf}.ww3)lfTr)rrospathexistsr )r/rrcomlocr6r6r7rbs  zWW3Init._copy_logcCsf|}|dd}t|jj}td|}|dd}tj |j||}|dd}|dd }|} t d D]} td| |} |j ||| |d } | s| d | d fd} tj| \} }|dkr| d| fd} |jdkr| d| dfd} | sqld| dd}t| |d|d|d}tdd|d|f}|rP|dk}t||ddSdS)z!Obtains WW3 input boundary condition data, links or copies to ww3init dir. WW3 input boundary data comes from previous cycle's gfswave.rTr^rtrur_r`rarbrJr.%s: cannot decide data location for this time.%Y%m%d%HN%s: does not existF'$%s: too small (should be >=%d bytes)zgfs.tz%Hz z.ibp_tarrz./gfswave.HWRF{vit[basin1lc]}*tarz-xvfz --wildcardsrr)rrrr1rArrBr?rrrangerrrrFr lstat_statst_sizer rrr)r/rrrJrr ww3catalogww3dcr[r\rqitry ww3bdyfileokLSZ ww3bdyspectarZ ww3bdyfbaserr6r6r7rjsJ          zWW3Init.get_ww3bdy_inputsc Cs|}t|jj}td|}|dd}tj|j||}|dd}|dd}|}|j ||||d} | s| d | d fd } t j | \} } | d kr| d tfd} | jdkr| d| dfd} | s|d| d ft| dd |dd S)z!Obtains global gdaswave restart file, links or copies to ww3init dir. WW3 input restart file comes from current cycle's gdaswave.r^rtrurfrgrhrirrrTNrFrrz3%s: ww3rst file from gdaswave not ok for this time.zrestart.gnh_10mr)rrr1rArrBr?rrrrrrFrrrrrr ) r/rrJrrrrr[r\rqZ ww3rstfilerrrr6r6r7rs<      zWW3Init.get_ww3rst_inputsc Cstj|j|j}|dd}|s,|d}t|jj}t }|j | ddt |dB}t dd,}| |j|f||d |jjd |W5QRXW5QRXdS) Ngint_inprz{PARMww3}/ww3_gint.inp_tmplr)rrz ww3_gint.inprTr)r?rrr1r2rBrrrAr=rrrrr)r/rrrrJrrrr6r6r7rs     zWW3Init.make_gint_inp)Nr#r$r$r$)N)__name__ __module__ __qualname__r'r(rSrsrrrrrrr __classcell__r6r6r4r7rs    X' c@s(eZdZdZddZddZddZdS) WW3IniterzThis is an internal implementation class that should never be used directly. It instructs the hwrf.coupling.CoupledWRF to call the WRFWW3POM.copy_ww3_inputs to check or link WW3 input data.cCs ||_dS)zeCreates a WW3Initer that will pass control to the given WRFWW3POM object, stored as self.wcp.N)wcp)r/rr6r6r7r'szWW3Initer.__init__cCs|jjddS)z9Calls the WRFWW3POM.copy_ww3_inputs with just_check=True.T) just_check)rcopy_ww3_inputs)r/rr6r6r7check_coupled_inputsszWW3Initer.check_coupled_inputscCs|jt|S)z7Calls the WRFWW3POM.copy_ww3_inputs passing just_check.)rr bool)r/r rr6r6r7link_coupled_inputsszWW3Initer.link_coupled_inputsN)rrr__doc__r'r r r6r6r6r7rsrFc Csd}|}|D]}|d}|j}|j}|r8|r8|s||d}|j}|j}|r`|r`|sd|jt|jt|jt|f}|jdkr||tjj jdddqn*|r||dS| |t j ||st|tj|d|d |d 7}q|d |dS) Nrr<z`WW3 product %s (available=%s location=%s localname=%s) is not available or has an empty locationz ww3init::nestzNWill run without WW3 input boundary condition because nest.ww3 does not exist.TrFrrzz&Copied %d WW3 inputs. Returning True.)rrSrI availablerdidreprrrFrrr?rrr rrbasenamer) ww3initr n_copiedrrN localnamelocavailrr6r6r7r sL         r ww3rstrestart%03d.ww3c CsP|jj}t||}t||}t|} | d} t| |} t} |} | | krj| |ksTt| | t| | } q@||| d}|j }| D]}|d7}d|kr||}n|}|}t j |j |}t|j|j||d}||d<||d<d|d <tt||d |d <d |d <||||qW5QRX|d|||d|dfdS)NrYrrz%)categoryrKrIstreamrIHminsizerT restarttimer|minagez+Created %d output %s products from %s to %sz %Y%m%d%H%M)r1rArrlistAssertionErrorappendadd_coupled_streamr0rDrrjoinrIr r%roundadd_coupled_productrdebugr)taskZrstbegrstdtZrstendrfmtrJZbegenddtroZeendtimesnowitimertimefilenamerKrIrNr6r6r7add_ww3_productsL           r3cs4eZdZdZd fdd ZddZd d d ZZS) WRFCoupledWW3aRuns a WRF-WW3 coupled simulation (no ocean). Most of the work of this class is done by the superclasses. This class adds code to copy the inputs needed by WW3 and the coupler. There are three critical new config section values: wm3c_ranks = number of coupler ranks. Default: 1 ww3_ranks = number of WW3 ranks. Default: 24 wrf_ranks = nubmer of WRF ranks. No default. This one is mandatory.Tauxhist1Nc  st|ts$tdt|jt|ftt|j||||||f|||_ t |} | dddd| dddd | | |j d d d } |j} | d krt||d|dd|j} | d krt|| | | ddddt||d|ddt||d|dddS)N]The ww3init argument to WRFCoupledWW3.__init__ must be a WW3Init object. You passed a %s %s.coupler hwrf_wm3c wm3c_ranksrzww3hwrf_ocean_fcst ww3_ranks0rrrrrTww3pnt out_pnt.ww3rrww3out out_grd.ww3Z ww3mdldefz mdl_def.ww3) isinstancer TypeErrortyperrr&r4r'rrcouple couplewrfr1rr-r3simendr.) r/r0r1r2wrfkeeprunwrfdiag_streamrr3 ww3initerrrr*r4r6r7r'*s2 zWRFCoupledWW3.__init__cCs |dSNuncoupler/r6r6r7 remove_waveEszWRFCoupledWW3.remove_waveFcCs t|j|SrLr rr/r r6r6r7r HszWRFCoupledWW3.copy_ww3_inputs)Tr5N)F)rrrrr'rPr rr6r6r4r7r4 s r4cCs|jddd}|j}|dkr8t||d|dd|j}|dkr`t||||ddd d t||d|d d t||d|d ddS)z!Helper function for WRFWW3POM and WRFWW3HYCOM constructors to reduce code duplication. Adds WW3 products to the forecast output. Should be run after superclass constructor.rrrrrTr>r?rzrrr@rA ww3moddef mod_def.ww3N)r1rr-r3rGr.)r/rrHrrr*r6r6r7 wave_setupMsrUcs@eZdZdfdd ZddZdd Zd d Zdd dZZS)rTr5Nc  sdt|ts$tdt|jt|f||_t||_t t |j |||||||f| t |||dS)Nr6) rBrrCrDrrrrrKr&rr'rU) r/r0r1r2rHrIrJpominitrr3r4r6r7r'as   zWRFWW3POM.__init__cCs|ddS)NpomrMrOr6r6r7 remove_oceannszWRFWW3POM.remove_oceancCs|ddSNr:rMrOr6r6r7rPqszWRFWW3POM.remove_wavecCs|dddd|jdSNr:r"r<r=rErKrOr6r6r7 _add_wavetszWRFWW3POM._add_waveFcCs t|j|SrLrQrRr6r6r7r wszWRFWW3POM.copy_ww3_inputs)Tr5NN)F rrrr'rXrPr\r rr6r6r4r7r`s cs@eZdZdfdd ZddZdd Zd d Zdd dZZS)rTr5Nc sft| ts$tdt| jt| f| |_t||_t t |j ||||||||f| t || |dS)Nz[The ww3init argument to WRFWW3HYCOM.__init__ must be a WW3Init object. You passed a %s %s.) rBrrCrDrrrrrKr&rr'rU) r/r0r1r2rHocstatusrIrJ hycominitrr3r4r6r7r'}s  zWRFWW3HYCOM.__init__cCs|ddS)NhycomrMrOr6r6r7rXszWRFWW3HYCOM.remove_oceancCs|ddSrYrMrOr6r6r7rPszWRFWW3HYCOM.remove_wavecCs|dddd|jdSrZr[rOr6r6r7r\szWRFWW3HYCOM._add_waveFcCs t|j|SrLrQrRr6r6r7r szWRFWW3HYCOM.copy_ww3_inputs)Tr5NN)Fr]r6r6r4r7r|s)z ./out_grd.ww3z{com}/{out_prefix}.out_grd.ww3)z ./gribfilez{com}/{out_prefix}.ww3.grb2)z./gribfile.idxz{com}/{out_prefix}.ww3.grb2.idx)z ./ww3.%Y.ncz{com}/{out_prefix}.ww3_ounf.nc)z ./out_pnt.ww3z{com}/{out_prefix}.out_pnt.ww3)z./ww3.%Y_spec.ncz#{com}/{out_prefix}.ww3_ounp_spec.nc)z./ww3_bull.tarz{com}/{out_prefix}.ww3_bull.tar)z./ww3_cbull.tarz {com}/{out_prefix}.ww3_cbull.tar)z./ww3_csbull.tarz!{com}/{out_prefix}.ww3_csbull.tar)z./ww3_spec.tarz{com}/{out_prefix}.ww3_spec.tar) ww3outgrdww3grb2 ww3grb2idxww3ounf ww3outpnt ww3ounpspec ww3outpbull ww3outpcbull ww3outpcsbull ww3outpspeccs~eZdZdZfddZddZdddZd d Zed d Z d dZ ddZ ddZ ddZ ddZddZddZZS)rzRun WW3 post-process.c s<tt|j|||f|||_||_||_|d|_dS)NF)r&rr'r,r-r:r( _ncks_path)r/dsr1r2r,r-r:r3r4r6r7r's zWW3Post.__init__c Cst|_tj|jj}|jht D]X\}}|\}}|jj |}t j |j||j}|||||_||d<||f|j|<q,W5QRXdS)zCreates FileProduct objects for all WW3Post output files. The outdir is the directory to which the WW3Post package output its final files.r<N)r=r>r?r@rr1rAr0rDww3postprodnamesrErrFrGrr%rHrI)r/rJrKrLr<rMrNr6r6r7r(s zWW3Post._make_productsNccs8|jD](\}}|\}}|dks,||jkr |Vq dSrOrP)r/rQrKrRrNr<r6r6r7rSszWW3Post.productscCsD|j}|}tjj||dtt|ddd||fdk|ddS)Nrz-4z-L6z /dev/null) ncks_pathrrFrrrr)r/rtargetignorencksrr6r6r7Z __copy_nckss zWW3Post.__copy_nckscCsV|jdkrP|dd}|js,tjjddd}|dksJt|trF|dksJt||_|jS)zReturns the path to ncks. Returns None if ncks cannot be found. This function will only search for ncks once, and will cache the result. Set self._ncks_path=False to force a recheck.Frrr) raise_missingN)rkrrFrfind_exerBrr")r/rrr6r6r7ros  zWW3Post.ncks_pathc1 Cs |}|dd}t|_ z^t|jd|dd :}dd|jjddDd}||rh|j rh|j s|| d t |ft |j d d|d |jdkrd d|jjd dDd}||r|j r|j s| dt |ft |j dd|d |jd\}}|j||j |dd|jdkrdd|jjddDd}||r\|j r\|j sp| dt |ft |j dd|d |jd\}}|j||j |dd|jdddd} | dkr|jdkrt|ddd|d ||td} |r| dk} t| |dd } |d!} |d"tt| d#| k|d|jd$\}}|j||j |dd|jd%\}}|j||j |dd|jd&ddd} |jd'ddd}|jdkr|#d:d?} |!| W5QRXq^d@}%t|%dA}&|&#dB$|W5QRXt%j&dC}'|dD|'t%j&'dEdF}(|(dFkr|dG}(t(t)|(dH|%fddI})t|)tdJdK|} t| |dtdJdL|} t| |dtdJdM|} t| |dtdN|dO?} t| |d|jdP\}}|j||j |dd|jdQ\}}|j||j |dd|jdR\}}|j||j |dd|dkr|-d:d?} |!| W5QRXq>dY}%t|%dA}&|&#dB$|W5QRXt%j&dC}'|dZ|'t%j&'dEdF}(|(dFkr|dG}(t(t)|(dH|%fddI})t|)tdJd[|*} t| |dtdN|d\?} t| |d|jd]\}}|j||j |dd|jd^ddd}.|.dkr|jdkrt|d_d_d|d |.|td`} |r| dak} t| |d|jdb\}}|dc||j f|j||j ||j/d|jddddd}/|/dk rh|jdk rht|deded|d |0|tdf} | r8| dgk} t| |d|jdh\}}|j||j ||j/dW5QRXt1|_WnDt2k r}0z$t3|_|j dit4|0fddjW5d}0~0XYnXdS)kzRun the WW3 post.rTrcSsg|]}|qSr6r6.0pr6r6r7 szWW3Post.run..rS)rrz/%s: mod_def.ww3 not yet available from forecastrTrcSsg|]}|qSr6r6rur6r6r7rxsr@z/%s: out_grd.ww3 not yet available from forecastrAraN)rrIrcopiercSsg|]}|qSr6r6rur6r6r7rxsr>z/%s: out_pnt.ww3 not yet available from forecastr?re ww3_grib_postr:ww3post)r2Zww3_gribz ./ww3_gribz ww3_grib.logrz gribfile.idxrz.ww3post: Generating grib idx file for gribfile)z-sZgribfilerbrcww3_outp_bull_postww3_outp_spec_postZww3_outpz ./ww3_outpzww3_outp_info.logcSsg|]\}}d|kr|qS)z ----------r6)rvielemr6r6r7rxsrzz&ww3_outp_bull for buoy: %i, %s, %s, %szww3outpbull.%srrz../out_pnt.ww3z.bullz.cbullz.csvz.csbullZww3_outp_bull_z.logzcd z && z./ww3_outp > ../zmv z ../ && z ../zcd ../zcommand.file.ww3outpbullr TOTAL_TASKSz ww3_outp_bull total threads: %s Z MPISERIALz *MISSING* mpiserialz-m)allranksr)-cvfz ww3_bull.tar)rz ww3_cbull.tar)rzww3_csbull.tarcatzww3_outp_bull.logrgrhriz%y%m%d%Hz&ww3_outp_spec for buoy: %i, %s, %s, %szww3outpspec.%szww3.z.spcZww3_outp_spec_zcommand.file.ww3outpspecz ww3_outp_spec total threads: %s )rz ww3_spec.tarzww3_outp_spec.logrj ww3_ounf_postZww3_ounfz ./ww3_ounfz ww3_ounf.logrdz Delivering ww3ounf from %s to %sww3_ounp_spec_postZww3_ounpz ./ww3_ounpz ww3_ounp.logrfzWW3 post failed: %sr)5rrrrrrr:rScheckrrIrrr r,r>rr-rBr r make_grib_inprrrrmake_outp_info_inpr readlines enumerater!splitmake_outp_bull_inpr#dirnamerr%renvirongetrrr1rArmake_outp_spec_inp make_ounf_inp_WW3Post__copy_ncksmake_ounp_spec_inprrr r)1r/rrrZmdprodZogprodrNr<Zopprodrzr indexfilerr|r}fnamerZ ww3_outp_infoindicesZbuoysZfilebullZ filecbullZ filecsbullZfilelogcommandsr~ZbuoyipntZbuoyidZbuoylonZbuoylatrZbuoybullZ buoycbullZbuoycsvZ buoycsbullZbuoylogZcmdfnameZcfpfthreadsZmpiserial_pathcmd2fileoutZww3tstrZbuoyspcZbuoyoutrrrr6r6r7rs                                                      z WW3Post.runc Cstj|j|j}|dd}|s,|d}t|jj}t }|j | dt |j | ddt|dB}tdd,}||j|f||d |jjd |W5QRXW5QRXdS) Ngrib_inprz{PARMww3}/ww3_grib.inp_tmplr)rrrrz ww3_grib.inprTrr?rrr1r2rBrrrAr=rrr+r,rrr)r/rrrrJrrrr6r6r7rs$      zWW3Post.make_grib_inpc Cstj|j|j}|dd}|s,|d}t|jj}t }|j | dt |j dt|dB}tdd,}||j|f||d |jjd |W5QRXW5QRXdS) Nounf_inprz{PARMww3}/ww3_ounf.inp_tmplr)rrrz ww3_ounf.inprTrr)r/rrrrJrrrr6r6r7rs"      zWW3Post.make_ounf_inpc Cstj|j|j}|dd}|s,|d}t|jj}t }|j | dt |j dt|dB}tdd,}||j|f||d |jjd |W5QRXW5QRXdS) N ounp_spec_inprz {PARMww3}/ww3_ounp_spec.inp_tmplrrrrz ww3_ounp.inprTrr?rrr1r2rBrrrAr=rrr+r-rrr)r/rrrrJrrrr6r6r7rs"      zWW3Post.make_ounp_spec_inpc Cstj|j|j}|dd}|s,|d}t|jj}t }|j | dt |j dt|dB}tdd,}||j|f||d |jjd |W5QRXW5QRXdS) N outp_info_inprz {PARMww3}/ww3_outp_info.inp_tmplrrr ww3_outp.inprTrr)r/rrrrJrrrr6r6r7rs"      zWW3Post.make_outp_info_inpc Cstj|j|j}|dd}|s,|d}t|jj}t }|j | dt |j t || ddt|dB}tdd,}||j|f||d |jjd |W5QRXW5QRXdS) N outp_bull_inprz {PARMww3}/ww3_outp_bull.inp_tmplrrrZPNT_NUMrrrrTrr) r/rrrrrJrrrr6r6r7rs&      zWW3Post.make_outp_bull_inpc Cstj|j|j}|dd}|s,|d}t|jj}t }|j | dt |j t || ddt|dB}tdd,}||j|f||d |jjd |W5QRXW5QRXdS) N outp_spec_inprz {PARMww3}/ww3_outp_spec.inp_tmplrrrrrTrr) r/rrrrrJrrrr6r6r7rs&      zWW3Post.make_outp_spec_inp)N)rrrrr'r(rSrpropertyrorrrrrrrrr6r6r4r7rs   J)F)rr)?r__all__rrprodutil.datastorerFprodutil.fileop produtil.cd produtil.run produtil.log hwrf.mpipomtcr? hwrf.hwrftask hwrf.numericshwrf.exceptions hwrf.namelist hwrf.coupling hwrf.input hwrf.hycomrrrr r r r r rrrrrrrrrrrrrrrrrChwrftaskHWRFTaskrcouplingComponentIniterrr r3 CoupledWRFr4rUmpipomtc WRFCoupledPOMrr`WRFCoupledHYCOMrrmrr6r6r6r7sP ((() % +-