Thursday, October 16, 2014

radmon summary

1. radmon step 1:  data_extract
It will create output: angle, bcoef, bcor and time for all cycles in a day.
./data_extract/ush/VrfyRad_glbl.sh    # wrapper  
export biascr=$DATDIR/biascr.gdas.${PDATE}
export radstat=$DATDIR/radstat.gdas.${PDATE}
  ||
  \/
./nwprod/jobs/JGDAS_VRFYRAD.sms.prod
  ||
  \/
./nwprod/scripts/exgdas_vrfyrad.sh.sms
   cd ${DATA}
   $NCP $biascr  ./biascr.$PDATE        # input 1
   $NCP $radstat ./radstat.$PDATE      # input 2
   tar -xvf radstat.$PDATE
   rm radstat.$PDATE
      mv    diag_${type}_ges.${PDATE}.${Z}     ${type}.${Z}      # diag_*_anl* still there
      ${UNCOMPRESS} ./${type}.${Z}

  ||
  \/
./nwprod/ush/radmon_verf_angle.sh   ==>  $TIMEX ./${angle_exec} < input >   ${stdout_file}
./nwprod/ush/radmon_verf_bcoef.sh    ==> $TIMEX  ./${bcoef_exec} < input >   stdout.$type
./nwprod/ush/radmon_verf_bcor.sh    ==> $TIMEX  ./${bcor_exec} < input >   stdout.$type
./nwprod/ush/radmon_verf_time.sh   ==>  $TIMEX  ./${time_exec} < input >   ${stdout_file}
 Also move data, control, and stdout files to $TANKverf_rad and compress.

 output:
/data/users/dxu/radmon_workspace/data/output/radmon_tank/stats/myolddata/radmon.20130731

angle.sndrd2_g15.2013073100.ieee_d.gz     # intermediate file
angle.sndrd2_g15.2013073106.ieee_d.gz
angle.sndrd2_g15.2013073112.ieee_d.gz
angle.sndrd2_g15.2013073118.ieee_d.gz
angle.sndrd2_g15.ctl.gz            // ctl file created by f90 code.      
angle.stdout.sndrd2_g15.gz     // log file for one of the cycles above.           


bcoef.sndrd2_g15.2013073100.ieee_d.gz
bcoef.sndrd2_g15.2013073106.ieee_d.gz
bcoef.sndrd2_g15.2013073112.ieee_d.gz
bcoef.sndrd2_g15.2013073118.ieee_d.gz
bcoef.sndrd2_g15.ctl.gz             
bcoef.stdout.sndrd2_g15.gz

bcor.sndrd2_g15.2013073100.ieee_d.gz
bcor.sndrd2_g15.2013073106.ieee_d.gz
bcor.sndrd2_g15.2013073112.ieee_d.gz
bcor.sndrd2_g15.2013073118.ieee_d.gz
bcor.sndrd2_g15.ctl.gz
bcor.stdout.sndrd2_g15.gz

time.sndrd2_g15.2013073100.ieee_d.gz
time.sndrd2_g15.2013073106.ieee_d.gz
time.sndrd2_g15.2013073112.ieee_d.gz
time.sndrd2_g15.2013073118.ieee_d.gz
time.sndrd2_g15.ctl.gz
time.stdout.sndrd2_g15.gz


2. how endianness is set:
1)  "./nwprod/ush/radmon_verf_time.sh"

LITTLE_ENDIAN=${LITTLE_ENDIAN:-0}   # default value is 0: big_endian

cat << EOF > input             # create namelist file that is input to f90 code.
 &INPUT
  satname='${type}',
  iyy=${iyy},
  imm=${imm},
  idd=${idd},
  ihh=${ihh},
  idhh=-720
  incr=6
  nchanl=${nchanl},
  suffix='${SUFFIX}',
  imkctl=${MAKE_CTL},
  imkdata=${MAKE_DATA},
  gesanl='${dtype}',
  little_endian=${LITTLE_ENDIAN},     
  rad_area='${RAD_AREA}',
 /
EOF
        $TIMEX ./${time_exec} < input >   ${stdout_file}     # namelist

2) ./nwprod/sorc/verf_radbcoef.fd/bcoef.f90: 

        integer               :: little_endian        = 1        # default is 1.
        namelist /input/ satname,npredr,nchanl,iyy,imm,idd,ihh,idhh,&
                incr,suffix,imkctl,imkdata,retrieval,gesanl,little_endian      # read from namelist
        read(luname,input)

       call create_ctl_bcoef(ntype,ftype,n_chan,iyy,imm,idd,ihh,idhh,&
            incr,ctl_file,lunctl,rmiss,mod_satname,satype,dplat,&
             nu_chan,use,penalty,frequency,wavenumbr,little_endian)


3) ./nwprod/sorc/verf_radbcoef.fd/create_ctl_bcoef.f90: 
     Purpose: this sub creates ctl file such as "bcor.sndrd2_g15.ctl"

 subroutine create_ctl_bcoef(ntype,ftype,n_chan,iyy,imm,idd,ihh,idhh,&
     incr,ctl_file,lunctl,rmiss,satname,satype,dplat,&
     nu_chan,use,ratio,frequency,wavenumbr,little_endian)
 if ( little_endian == 1 ) then
     write(lunctl,112)         # 1 means little-endian
  else
     write(lunctl,110)         # 0 means big_endian
  endif

110 format('options template big_endian cray_32bit_ieee sequential')
112 format('options template little_endian sequential')




 

radmon little endian version: 
SVN: https://svnemc.ncep.noaa.gov/projects/gsi/branches/NESDIS-JCSDA/users/dxu/radmon_addition/radmon_little_endian/

3. step 2 : generate images 
1) code tracing : 
./image_gen/ush/mk_bcoef_plots.sh
     $SUB -J ${jobname} -s -o ${logfile} -e ${logfile} $SCRIPTS/plot_bcoef.sh


./ush/plot_bcoef.sh
plot_bcoef=plot_bcoef.gs            # fixed grads script
 cat << EOF > ${type}_${var}.gs        # Create wrapper gs file on the fly
'open ${type}.ctl'                 # ctl file created by f90 above.
'run ${GSCRIPTS}/${plot_bcoef} ${type} ${var} x1100 y850'
'quit'
EOF
      $GRADS -bpc "run ${tmpdir}/${type}_${var}.gs"

2)  Wrapper grads script : ${type}_${var}.gs
'open amsua_metop-a.ctl'
'run plot_bcor_sep.glb.gs     amsua_metop-a   total    1    x1100     y850'
'quit'
 


http://www.iges.org/grads/gadoc/descriptorfile.html
The best way to ensure hardware independence for gridded data is to specify the data's source platform. This facilitates moving data files and their descriptor files between machines; the data may be used on any type of hardware without having to worry about byte ordering. The following three OPTIONS keywords are used to describe the byte ordering of a gridded or station data file:
big_endian Indicates the data file contains 32-bit IEEE floats created on a big endian platform (e.g., sun, sgi)
little_endian Indicates the data file contains 32-bit IEEE floats created on a little endian platform (e.g., iX86, and dec)
cray_32bit_ieee Indicates the data file contains 32-bit IEEE floats created on a cray.

4. How to install radmon


$ cd /data/users/dxu/radmon_pkg/radmon/util/Radiance_Monitor

$ vi ./RadMon_install.pl
$ vi parm/RadMon_config
$ ./RadMon_install.pl 
Note: Configuration in RadMon_install.pl overwrites both parm/RadMon_config and parm/RadMon_user_settings. So configuration in RadMon_install.pl has 
higher preference. 



5. How to run radmon
1) data_extract: 
How: 
   $ cd   /data/users/dxu/radmon_pkg/radmon/util/Radiance_Monitor/data_extract/ush
   $ cat  run_radmon_kgarrett   |head -3
   ./VrfyRad_glbl.sh   kgarrett_radmon     2014051500      #  kgarrett_radmon    is ID
   ./VrfyRad_glbl.sh   kgarrett_radmon     2014051506
   ./VrfyRad_glbl.sh   kgarrett_radmon     2014051512

   $   .   run_radmon_kgarrett        # run by each cycle

input dir:
   /data/users/dxu/radmon_workspace/data/input/radmon_input_for_kevin
File:
           radstat.gdas.2014061000
           biascr.gdas.2014061000
run dir:
   /data/users/dxu/radmon_workspace/run/dxu/gdas_vrfyrad_2014060218.4056
File:
  ./amsua_metop-a
  ./diag_amsua_metop-a_anl.2014060218.gz
  ./amsua_metop-a.ctl
  ./stdout.amsua_metop-a
  ./amsua_metop-a.deyong
output dir:
   /data/users/dxu/radmon_workspace/data/output/radmon_tank/stats/kgarrett_radmon/radmon.20140603
File:
 ./bcoef.amsua_metop-a.2014060300.ieee_d.gz
  ./angle.amsua_metop-a.2014060300.ieee_d.gz
  ./time.amsua_metop-a.2014060300.ieee_d.gz
  ./bcor.amsua_metop-a.2014060300.ieee_d.gz
 ./bcoef.amsua_metop-a.ctl.gz
 ./time.amsua_metop-a.ctl.gz
  ./angle.amsua_metop-a.ctl.gz
  ./bcor.amsua_metop-a.ctl.gz
2) image_gen
How: 
   $ cd /data/users/dxu/radmon_for_kg/util/Radiance_Monitor/image_gen/ush
   $   ./CkPlt_glbl.sh  run_radmon_kgarrett         # run with a shot, no need to specify cycle.

input dir:  
    /data/users/dxu/radmon_workspace/data/output/radmon_tank/stats/kgarrett_radmon/radmon.20140603
File:  ./bcoef.amsua_metop-a.2014060300.ieee_d.gz
  ./angle.amsua_metop-a.2014060300.ieee_d.gz
  ./time.amsua_metop-a.2014060300.ieee_d.gz
  ./bcor.amsua_metop-a.2014060300.ieee_d.gz
 ./bcoef.amsua_metop-a.ctl.gz
 ./time.amsua_metop-a.ctl.gz
  ./angle.amsua_metop-a.ctl.gz
  ./bcor.amsua_metop-a.ctl.gz
run dir: 
   /data/users/dxu/radmon_workspace/run/dxu/plotjobs_kgarrett_radmon
   /data/users/dxu/radmon_workspace/run/dxu/plot_summary_kgarrett_radmon.20140
   /data/users/dxu/radmon_workspace/run/dxu/horiz_kgarrett_radmon.2014061018
File: omitted here because too many. 

output dir:
   /data/users/dxu/radmon_workspace/data/output/radmon_tank/imgn/kgarrett_radmon/pngs
File:
bcor/iasi_metop-a.lapse_region4_fr88.png
time/iasi_metop-a.omgnbc_region3_fr93.png
bcoef/iasi_metop-a.mean_fr128.png
angle/iasi_metop-a.omgnbc_region2_fr61.png
horiz/hirs4_metop-b.obs_10.png
summary/atms_npp.summary.png

3) job submission setting in RadMon_config 
elif [[ $MY_MACHINE = "cardinal" ]]; then
   shell=sh
   export SUB=/usr/bin/sbatch       # submit job to job scheduler slurm
   export NWPROD=/usr/local/jcsda/nwprod_gdas_2014
   export COMPRESS=gzip
   export UNCOMPRESS="gunzip -f"
   export TIMEX=
   export UTILS_BIN=

6. "RadMon_install.pl" updates configuration files.
Users configures "RadMon_install.pl", which will update two configuration files in sub-dir "parm":

"./parm/RadMon_config"
"./parm/RadMon_user_settings"

1) When it updates "parm/RadMon_config", it updates following fields:
      if( $_ =~ "MY_RADMON=" ) {
      elsif( $_ =~ "MY_TANKDIR=" ) {
      elsif( $_ =~ "WEB_SVR=" ) {
      elsif( $_ =~ "WEB_USER=" ) {
      elsif( $_ =~ "WEBDIR=" ) {
      elsif( $_ =~ "LITTLE_ENDIAN=" ) {
      elsif( $_ =~ "MY_MACHINE=" ) {
      elsif( $_ =~ "PTMP=" ) {
      elsif( $_ =~ "STMP=" ) {


2) When it updates "./parm/RadMon_user_settings", it updates following fields:
       if ($line =~ m/export ACCOUNT/) {
       elsif( $line =~ m/export PROJECT/ ){
       elsif( $line =~ m/export JOB_QUEUE/ ){
       elsif( $line =~ m/export HPSS_DIR/ ){

7. Platform-related files 
Note: These files contain platform name such as "zeus", "jibb" etc. Need to update these files if new platform is added. 

makeall.sh
get_hostname.pl
RadMon_install.pl
data_extract/ush/VrfyRad_glbl.sh
image_gen/ush/CkPlt_glbl.sh
image_gen/parm/plot_rad_conf







No comments:

Post a Comment