[Dart-dev] [5849] DART/branches/development/models/noah: Better checking for a successful Noah run,

nancy at ucar.edu nancy at ucar.edu
Fri Aug 17 10:53:45 MDT 2012


Revision: 5849
Author:   thoar
Date:     2012-08-17 10:53:45 -0600 (Fri, 17 Aug 2012)
Log Message:
-----------
Better checking for a successful Noah run,
ability to handle arbitrary hour-long advances.

Modified Paths:
--------------
    DART/branches/development/models/noah/dart_to_noah.f90
    DART/branches/development/models/noah/shell_scripts/advance_model.csh

-------------- next part --------------
Modified: DART/branches/development/models/noah/dart_to_noah.f90
===================================================================
--- DART/branches/development/models/noah/dart_to_noah.f90	2012-08-17 03:48:04 UTC (rev 5848)
+++ DART/branches/development/models/noah/dart_to_noah.f90	2012-08-17 16:53:45 UTC (rev 5849)
@@ -164,6 +164,7 @@
    iunit = open_file('noah_advance_information.txt',form='formatted',action='write')
    call print_date(  model_time,'dart_to_noah:noah  model      date',iunit)
    call print_date( adv_to_time,'dart_to_noah:noah  advance_to_date',iunit)
+   write(iunit,'(''khour  = '',i6)') nfiles-1
    write(iunit,'(''nfiles = '',i6)') nfiles
 
    mytime = model_time

Modified: DART/branches/development/models/noah/shell_scripts/advance_model.csh
===================================================================
--- DART/branches/development/models/noah/shell_scripts/advance_model.csh	2012-08-17 03:48:04 UTC (rev 5848)
+++ DART/branches/development/models/noah/shell_scripts/advance_model.csh	2012-08-17 16:53:45 UTC (rev 5849)
@@ -107,20 +107,34 @@
    ln -sf ../$input_file       dart_restart || exit 2
    ../dart_to_noah                          || exit 2
 
-   # Extract the right forcing timestep from a single forcing file
-   # and create the appropriate 'one-time-use' forcing file for this
-   # ensemble member.
+   # This next two parts are based on using one-hour forcing files
+   # since the minimum time to advance the model seems to be 1 hour.
+   # (kday, khour, but no kminute, for example)
+   # dart_to_noah provides the setting for namelist.hrldas:khour
+   # we need to put that value in the local copy of namelist.hrldas
+
+   set numadvancestr = `grep -i khour noah_advance_information.txt`
+   set numadvancestr = `echo $numadvancestr | sed -e "s#[=,']# #g"`
+   set numadvancestr = `echo $numadvancestr | sed -e 's#"# #g'`
+   set numadvances   = `echo $numadvancestr[2]`
+
+ex namelist.hrldas <<ex_end
+g;KHOUR ;s;= .*;= $numadvances;
+wq
+ex_end
+
    # The forcing has to be for the NEXT "FORCING_TIMESTEP", apparently.
-   # FORCING_TIMESTEP is defined in namelist.input
+   # FORCING_TIMESTEP is defined in namelist.input At this point, dart_to_noah
+   # has assumptions that the forcing_timestep is one hour.
 
-   set numfilestring = `head -3 noah_advance_information.txt | tail -1`
+   set numfilestring = `head -4 noah_advance_information.txt | tail -1`
    set numfilestring = `echo $numfilestring | sed -e "s#[=,']# #g"`
    set numfilestring = `echo $numfilestring | sed -e 's#"# #g'`
-   @ numfiles        = `echo $numfilestring[2]`
+   set numfiles      = `echo $numfilestring[2]`
 
    @ ifile = 1
    while ($ifile <= $numfiles)
-      @ linenum = 3 + $ifile
+      @ linenum = 4 + $ifile
       set FNAME = `head -${linenum} noah_advance_information.txt | tail -1`
       ln -sf ${LDASINDIR}/${FNAME} .
       @ ifile = $ifile + 1
@@ -139,9 +153,11 @@
 
    ../Noah_hrldas_beta
 
-   if (! -e RESTART* ) then
+   set noah_status = `ls -1 RESTART*DOMAIN* | wc -l`
+   if ($noah_status < 1)  then
       echo "ERROR: NOAH died"
       echo "ERROR: NOAH died"
+      ls -l
       exit 23
    endif
 


More information about the Dart-dev mailing list