#!/bin/sh # NOTE: To ensure reproducible results, must use same number of # MPI tasks AND nodes for each run. blocking=unlimited # leads to roundoff differences in mpi_allreduce. ## Below are LoadLeveler (IBM queueing system) commands #@ job_name=gsireg_2d_binary #@ error=gsireg_2d_binary.e$(jobid) #@ job_type=parallel #@ network.MPI=csss,shared,us #@ total_tasks=24 #@ blocking=unlimited #@ class= dev #@ group=devonprod #@ account_no = RDAS-T2O #@ wall_clock_limit = 1:00:00 #@ startdate = 10/27/05 20:00 #@ notification=error #@ queue set -x # Set MPI environment variables for NCEP IBM export MP_SHARED_MEMORY=yes export XLFRTEOPTS="nlwidth=80" export MP_LABELIO=yes # Set environment variables for threads export SPINLOOPTIME=10000 export YIELDLOOPTIME=40000 export AIXTHREAD_SCOPE=S export MALLOCMULTIHEAP=true export XLSMPOPTS="parthds=1:spins=0:yields=0:stack=128000000" # Variables for debugging (don't always need) ##export XLFRTEOPTS="buffering=disable_all" ##export MP_COREFILE_FORMAT=lite # Set experiment name and analysis date exp=gsi_cvs.200609 adate=2005061700 # Set path/file for gsi executable gsiexec=/nfsuser/g01.1/weather/wx20rt/gsi_anl/sorc/$exp/gsi_anl # Set resoltion and other dependent parameters export JCAP=62 export LEVS=60 export DELTIM=${DELTIM:-$((3600/($JCAP/20)))} # Set runtime and save directories tmpdir=/ptmp/wx20rt/tmpreg_2d_binary/$exp savdir=/ptmp/wx20rt/outreg/2d_binary/$exp # Specify GSI fixed field and data directories. fixgsi=/nfsuser/g01.1/weather/wx20rt/gsi_anl/fix/$exp datobs=/nfsuser/g01.1/weather/wx20rt/gsi_anl/cases/regional/2d_binary/$adate datges=$datobs # Set variables used in script # CLEAN up $tmpdir when finished (YES=remove, NO=leave alone) # ncp is a fast copy using rcp between NCEP IBM nodes # (ncp does not yet work on blue, redefine ncp=/bin/cp) # ndate is a date manipulation utility CLEAN=YES ##ncp=/u/wx20mi/bin/ncp ncp=/bin/cp ndate=/nwprod/util/exec/ndate # Given the analysis date, compute the date from which the # first guess comes. Extract cycle and set prefix and suffix # for guess and observation data files gdate=`$ndate -12 $adate` cya=`echo $adate | cut -c9-10` cyg=`echo $gdate | cut -c9-10` prefixa=nam.t${cya}z prefixg=na12snmm.t${cyg}z suffix=tm00.bufr_d # Set up $tmpdir rm -rf $tmpdir mkdir -p $tmpdir cd $tmpdir rm -rf core* # Make gsi namelist cat << EOF > gsiparm.anl &SETUP miter=2,niter(1)=100,niter(2)=100, write_diag(1)=.true.,write_diag(2)=.false.,write_diag(3)=.true., gencode=78,qoption=1, factqmin=1.0,factqmax=1.0,deltim=$DELTIM, ndat=5,iguess=-1, oneobtest=.false.,retrieval=.false.,diag_pcp=.false.,diag_ozone=.false., nhr_assimilation=3, / &GRIDOPTS JCAP=$JCAP,NLAT=$NLAT,NLON=$LONA,nsig=$LEVS,hybrid=.true., wrf_nmm_regional=.false.,wrf_mass_regional=.false.,twodvar_regional=.true., diagnostic_reg=.false., filled_grid=.false.,half_grid=.true.,netcdf=.false., / &BKGERR as=0.35,0.35,0.35,0.50,0.50,0.80,1.00,1.00, hzscl=1.414,1.000,0.707, vs=0.5,bw=0.0, / &ANBKGERR anisotropic=.true.,an_vs=0.5,ngauss=1 an_flen_u=-5.,an_flen_t=3.,an_flen_z=-200., ifilt_ord=2,npass=3,normal=-200,grid_ratio=2.,nord_f2a=4, / &JCOPTS jcterm=.false.,jcdivt=.false.,bamp_ext1=1.0e6,bamp_ext2=1.0e6, bamp_int1=1.0e5, bamp_int2=1.0e4 / &STRONGOPTS nstrong=0,nvmodes_keep=8,period_max=6.,period_width=1.5,nstrong_end=0,update_end=.false., / &OBSQC dfact=0.75,dfact1=3.0,noiqc=.false., vadfile='prepbufr', / &OBS_INPUT dmesh(1)=60.0,dmesh(2)=60.0,dmesh(3)=60.0,dmesh(4)=60.0,time_window_max=1.5, dfile(01)='prepbufr', dtype(01)='ps', dplat(01)=' ', dsis(01)='ps', dval(01)=1.0, dthin(01)=0, dfile(02)='prepbufr' dtype(02)='t', dplat(02)=' ', dsis(02)='t', dval(02)=1.0, dthin(02)=0, dfile(03)='prepbufr', dtype(03)='q', dplat(03)=' ', dsis(03)='q', dval(03)=1.0, dthin(03)=0, dfile(04)='prepbufr', dtype(04)='uv', dplat(04)=' ', dsis(04)='uv', dval(04)=1.0, dthin(04)=0, dfile(05)='prepbufr', dtype(05)='spd', dplat(05)=' ', dsis(05)='spd', dval(05)=1.0, dthin(05)=0, / &SUPEROB_RADAR / &SINGLEOB_TEST maginnov=0.1,magoberr=0.1,oneob_type='t', oblat=36.,oblon=260.,obpres=1000.,obdattim=${adate}, obhourset=0., / EOF # Set fixed files # berror = forecast model background error statistics # specoef = CRTM spectral coefficients # trncoef = CRTM transmittance coefficients # emiscoef = CRTM coefficients for IR sea surface emissivity model # aerocoef = CRTM coefficients for aerosol effects # cldcoef = CRTM coefficients for cloud effects # satinfo = text file with information about assimilation of brightness temperatures # satangl = angle dependent bias correction file (fixed in time) # pcpinfo = text file with information about assimilation of prepcipitation rates # ozinfo = text file with information about assimilation of ozone data # errtable = text file with obs error for conventional data (regional only) # convinfo = text file with information about assimilation of conventional data # bufrtable= text file ONLY needed for single obs test (oneobstest=.true.) # bftab_sst= bufr table for sst ONLY needed for sst retrieval (retrieval=.true.) berror=$fixgsi/regional_glb_berror.f77 errtable=$fixgsi/nam_errtable.r3dv convinfo=$fixgsi/regional_convinfo.txt # Only need this file for single obs test bufrtable=$fixgsi/prepobs_prep.bufrtable # Copy executable and fixed files to $tmpdir $ncp $gsiexec ./gsi.x $ncp $berror ./berror_stats $ncp $convinfo ./convinfo $ncp $errtable ./errtable $ncp $bufrtable ./prepobs_prep.bufrtable # Copy observational data to $tmpdir $ncp $datobs/prepbufr.nam.meso_no.$adate ./prepbufr # Copy first guess $ncp $datges/wrfges.nam.meso_no.$adate ./wrf_inout # Run gsi under Parallel Operating Environment (poe) on NCEP IBM poe hpmcount $tmpdir/gsi.x < gsiparm.anl > stdout rc=$? # Save output mkdir -p $savdir cat stdout fort.2* > $savdir/stdout.anl.${adate} $ncp wrf_inout $savdir/wrfanl.${adate} # Loop over first and last outer loops to generate innovation # diagnostic files for indicated observation types (groups) # # NOTE: Since we set miter=2 in GSI namelist SETUP, outer # loop 03 will contain innovations with respect to # the analysis. Creation of o-a innovation files # is triggered by write_diag(3)=.true. The setting # write_diag(1)=.true. turns on creation of o-g # innovation files. # loops="01 03" for loop in $loops; do # Collect diagnostic files for obs types (groups) below list="hirs2_n14 msu_n14 sndr_g08 sndr_g10 sndr_g12 sndr_g08_prep sndr_g10_prep sndr_g12_prep sndrd1_g08 sndrd2_g08 sndrd3_g08 sndrd4_g08 sndrd1_g10 sndrd2_g10 sndrd3_g10 sndrd4_g10 sndrd1_g12 sndrd2_g12 sndrd3_g12 sndrd4_g12 hirs3_n15 hirs3_n16 hirs3_n17 amsua_n15 amsua_n16 amsua_n17 amsub_n15 amsub_n16 amsub_n17 hsb_aqua airs_aqua amsua_aqua imgr_g08 imgr_g10 imgr_g12 pcp_ssmi_dmsp pcp_tmi_trmm conv sbuv2_n16 sbuv2_n17 sbuv2_n18 omi_aura ssmi_f13 ssmi_f14 ssmi_f15 hirs4_n18 amsua_n18 mhs_n18 amsre_low_aqua amsre_mid_aqua amsre_hig_aqua ssmis_las_f16 ssmis_uas_f16 ssmis_img_f16 ssmis_env_f16" for type in $list; do count=`ls ${tmpdir}/${type}_${loop}* | wc -l` if [[ count -gt 0 ]]; then cat ${tmpdir}/${type}_${loop}.* > ${tmpdir}/diag_${type}_${loop} compress ${tmpdir}/diag_${type}_${loop} if [[ "$loop" = "01" ]]; then mv ${tmpdir}/diag_${type}_${loop}.Z $tmpdir/diag_${type}_ges.${adate}.Z ${ncp:-cp} $tmpdir/diag_${type}_ges.${adate}.Z $savdir/diag_${type}_ges.${adate}.Z elif [[ "$loop" = "03" ]]; then mv ${tmpdir}/diag_${type}_${loop}.Z $tmpdir/diag_${type}_anl.${adate}.Z ${ncp:-cp} $tmpdir/diag_${type}_anl.${adate}.Z $savdir/diag_${type}_anl.${adate}.Z else mv ${tmpdir}/diag_${type}_${loop}.Z $tmpdir/diag_${type}_${loop}.${adate}.Z ${ncp:-cp} $tmpdir/diag_${type}_${loop}.${adate}.Z $savdir/diag_${type}_${loop}.${adate}.Z fi fi done done # If requested, clean up $tmpdir if [[ "$CLEAN" = "YES" ]];then cd $tmpdir cd ../ if [[ $rc -eq 0 ]];then rm -rf $tmpdir fi fi # End of script exit