

#!/client/bin/bash

echo +++++++++++++++++++++++++++++++++++
echo +++++++++++++++++++++++++++++++++++
echo ++++++++++  2010100100
echo +++++++++++++++++++++++++++++++++++
echo +++++++++++++++++++++++++++++++++++

#################################################
# load leveler commands
#################################################
# @ shell = /client/bin/ksh
# @ job_type = parallel
# @ node_usage= shared
# @ node = 1
# @ tasks_per_node = 1
# @ resources = ConsumableMemory(1500mb)
# @ task_affinity = core(1)
# @ wall_clock_limit = 00:15:00
# @ job_name = int2lm.job
# @ output = int2lm.output
# @ error = int2lm.error
# @ notification = error
# @ class=express
# @ queue
export MEMORY_AFFINITY=MCM
export MP_PRINTENV=YES
export MP_LABELIO=YES
export MP_INFOLEVEL=2
export MP_EAGER_LIMIT=64k
export MP_BUFFER_MEM=64M,256M
export MP_USE_BULK_XFER=NO
export MP_BULK_MIN_MSG_SIZE=128k
export MP_RFIFO_SIZE=4M
export MP_SHM_ATTACH_THRESH=500000
export LAPI_DEBUG_STRIPE_SEND_FLIP=8
#

#################################################
# cat together the INPUT-file
#################################################

cat > INPUT << end_input
 &CONTRL
  ydate_ini='2010100100',
  hstart=0.0,
  hstop=96.0,
  hincbound=6.0,
  nprocx=1,
  nprocy=1,
  lreorder=.TRUE.,
  lgme2lm=.FALSE.,
  lec2lm=.FALSE.,
  llm2lm=.FALSE.
  lcm2lm=.TRUE.,
  linitial=.TRUE.,
  lboundaries=.TRUE.,
  lbdclim=.TRUE.,
  luvcor=.TRUE.,
  l_cressman=.TRUE.,
  idbg_level=2,
  ltime_mean=.FALSE.,
  lforest=.TRUE.,
  lsso=.TRUE.,
  llake=.FALSE.,
  lprog_qi=.TRUE.,
  lmulti_layer_lm=.TRUE.,
  lmulti_layer_in=.TRUE.,
  itype_w_so_rel=1,
  itype_t_cl=1,
  itype_rootdp=3,
  itype_ndvi=2,
  itype_albedo=2,
  lt_cl_corr=.FALSE.,
  luse_t_skin=.TRUE.,
  lfilter_oro=.TRUE.,
  eps_filter=0.1,
  lfilter_pp=.TRUE.,
  lbalance_pp=.TRUE.,
  llbc_smooth=.FALSE.,
  nlbc_smooth=20,
 /
 &GRID_IN  
  pcontrol_fi = 30000., 
  ie_in_tot=512,
  je_in_tot=256,
  ke_in_tot=60,
  ke_soil_in = 3,
  czml_soil_in = 0.015, 0.100, 0.405, 1.205,
  pollat_in = 90.0,
  pollon_in = 180.0,
  startlat_in_tot=-89.46282,
  startlon_in_tot=-180.0,
  endlat_in_tot=89.46282,
  endlon_in_tot=179.2969,
  lushift_in = .FALSE.,
  lvshift_in = .FALSE.,
 /
 &LMGRID
  pollat = 80.0,
  pollon = -72.0,
  polgam = 0.0,
  dlon = 0.44,
  dlat = 0.44,
  startlat_tot = -22.2,
  startlon_tot = -39.2,
  ielm_tot=200,
  jelm_tot=140,
  kelm_tot=35,
  ke_soil_lm = 9, 
  czml_soil_lm = 0.005, 0.0025, 0.07, 0.16, 0.34, 0.70, 1.42, 2.86, 5.74, 11.5,
  irefatm = 2,
  ivctype = 2,
  vcflat = 11000.0,
  vcoord_d = 30000., 27800., 25710., 23730., 21860., 20090., 18420., 16840., 15360., 13970.,
  12670., 11450., 10320., 9260., 8280., 7370., 6540., 5770., 5060., 4420., 3830., 3300.,
  2820., 2390., 2010., 1670., 1370., 1110., 880., 690., 520., 370., 250., 150., 70., 0.,
  delta_t = 75.0,
  h_scal = 10000.0, 
 /
 &DATABASE
 /
 &DATA
  ie_ext=220,
  je_ext=160,
  ylmext_lfn='ext.nc'
  ylmext_cat='/work/bb0871/2014/201010/temporal/extdata/',
  yinext_lfn='caf2010100100.nc',
  yinext_cat='/pf/b/b304058/CCLM/2014/201010/INT2LM/2010100100_dir/inputdata/',
  yin_cat='/pf/b/b304058/CCLM/2014/201010/INT2LM/2010100100_dir/inputdata/',
  ylm_cat='/work/bb0871/2014/201010/temporal/2010100100_044',
  yinext_form_read="ncdf",
  ylmext_form_read="ncdf",
  yin_form_read="ncdf",
  ylm_form_write="ncdf",
  nprocess_ini = 131, nprocess_bd = 132,
  nl_soil_in=4,nl_soil_lm=7
  ytunit_in='d',
  ytunit_out='d'
  yinput_type='analysis' 
 /
 &PRICTR
  igp_tot = 36, 40, 48, 44, 48, 85, 77
  jgp_tot = 30, 94, 38, 26, 26, 96, 12
  lchkin=.TRUE., lchkout=.TRUE.,
 /
end_input
#################################################
# run the program
#################################################


rm -f YUCHKDAT YUTIMING YUDEBUG OUTPUT




poe /pf/b/b304058/CCLM/2014/201010/INT2LM/tstint2lm


