Merge remote-tracking branch 'origin/release-v4.5'
[WRF.git] / tools / regtest_nmmnest.csh
blob7a0178c11ff93992a08d67b0fe2563c9508a555d
1 #!/bin/csh
3 # #BSUB -x # exlusive use of node (not_shared)
4 # #BSUB -a mpich_gm # at NCAR: lightning
5 # #BSUB -R "span[ptile=2]" # how many tasks per node (1 or 2)
6 #BSUB -a poe # at NCAR: bluevista
7 #BSUB -R "span[ptile=4]" # how many tasks per node (up to 8)
8 #BSUB -n 4 # number of total tasks
9 #BSUB -o reg.out # output filename (%J to add job id)
10 #BSUB -e reg.err # error filename
11 #BSUB -J regtest # job name
12 #BSUB -q share # queue
13 #BSUB -W 12:00 # wallclock time
14 ##BSUB -P 48500053
15 #BSUB -P 64000400
17 # QSUB -q ded_4 # submit to 4 proc
18 # QSUB -l mpp_p=4 # request 4 processors
19 # QSUB -lT 21600 # max. job time limit is 6 h
20 # QSUB -lF 250Mw # max. job file size limit is 250 Megawords
21 # QSUB -eo # merge error and output into one file
22 # QSUB -o reg.out # output file name
23 # QSUB # there are no further QSUB commands
25 # This is a script to test the bit-for-bit reproducibility of
26 # the WRF model, when comparing single processor serial runs to
27 # OpenMP and MPI parallel runs. There are several regression tests
28 # that are performed. Failed comparisons get reported, but don't
29 # stop the script. Failed builds or forecasts force an exit from
30 # the script.
32 # Approximate time for completion of full test suite
33 # Compaq 733 MHz ev67 : 2.5 hours (empty)
34 # Intel 1.2 GHz (4-pe) : 3.0 hours (empty)
35 # IBM P4 : 2.0 hours (empty)
37 setenv HWRF 0
38 # Do we keep running even when there are BAD failures?
40 set KEEP_ON_RUNNING = FALSE
41 set KEEP_ON_RUNNING = TRUE
43 # These need to be changed for your particular set of runs. This is
44 # where email gets sent.
46 if ( ( `uname` == AIX ) && ( ( `hostname | cut -c 1-2` != bs ) && \
47 ( `hostname | cut -c 1-2` != bv ) && ( `hostname | cut -c 1-2` != be ) ) ) then
48 set FAIL_MAIL = ( ${user}@noaa.gov )
49 set GOOD_MAIL = ( ${user}@noaa.gov )
51 setenv MP_EAGER_LIMIT 65536
52 setenv MP_SHARED_MEMORY yes
53 setenv MP_SINGLE_THREAD yes
54 setenv MP_LABELIO yes
55 setenv MP_STDOUTMODE ordered
57 setenv OMP_NUM_THREADS 4
58 setenv XLSMPOPTS "parthds=4:spins=0:yields=0:stack=128000000:schedule=static"
59 setenv AIXTHREAD_SCOPE S
60 setenv AIXTHREAD_MNRATIO 1:1
61 setenv SPINLOOPTIME 1000
62 setenv YIELDLOOPTIME 1000
63 else
64 set FAIL_MAIL = ( ${user}@ucar.edu )
65 set GOOD_MAIL = ( ${user}@ucar.edu )
66 endif
68 unalias cd cp rm ls pushd popd mv
69 if ( ( `uname` == Linux ) || ( `uname` == Darwin ) ) alias banner echo
71 # Get the command line input
73 set thedate = -999
74 set thefile = "null"
75 set thedata = "null"
76 set clrm = 0 # compile local run mmmtmp, for using clsroom cluster and local disk
78 # If this is a batch job (NCAR's IBMs or FSL's Intel and Alpha), we need to muck with the "input"
79 # parameters a bit.
81 if ( ( `uname` == AIX ) || ( `hostname` == tempest ) || ( `hostname | cut -c 1-2` == ln ) ) then
82 set argv = ( -here )
83 set argv = ( -ftp )
84 set argv = ( -D today )
85 set argv = ( -env )
86 set WRFREGFILE = /mmm/users/gill/wrf.tar
87 if ( ( `uname` == AIX ) && ( ( `hostname | cut -c 1-2` != bs ) && \
88 ( `hostname | cut -c 1-2` != bv ) && ( `hostname | cut -c 1-2` != be ) ) ) then
89 set argv = ( -f /nbns/meso/wx22tb/regression_tests/wrf.tar )
90 else
91 set argv = ( -f wrf.tar )
92 endif
93 endif
95 # Where is the input data located - for a few known NCAR/MMM machines.
97 if ( ( `hostname` == master ) || (`hostname | cut -c 1-4` == node ) ) then
98 set WRFREGDATAEM = /big/users/gill/WRF-data-EM
99 set WRFREGDATANMM = /big/users/gill/WRF-data-NMM
100 else if ( `hostname` == jacaranda ) then
101 set WRFREGDATAEM = /jacaranda/users/gill/WRF-data-EM
102 set WRFREGDATANMM = /jacaranda/users/gill/WRF-data-NMM
103 else if ( `hostname` == stink ) then
104 set WRFREGDATAEM = /stink/gill/Regression_Tests/WRF_regression_data/processed
105 set WRFREGDATANMM = /stink/gill/Regression_Tests/WRF_regression_data/WRF-data-NMM
106 else if ( `hostname` == cape ) then
107 set WRFREGDATAEM = /cape/users/michalak/WRF-data-EM
108 set WRFREGDATANMM = /cape/users/michalak/WRF-data-NMM
109 else if ( (`hostname | cut -c 1-6` == joshua ) || \
110 ( `hostname` == maple ) || (`hostname | cut -c 1-7` == service ) ) then
111 set WRFREGDATAEM = /users/gill/WRF-data-EM
112 set WRFREGDATANMM = /users/gill/WRF-data-NMM
113 else if ( ( `hostname | cut -c 1-2` == bs ) || ( `hostname` == tempest ) || ( `hostname | cut -c 1-2` == ln ) || \
114 ( `hostname | cut -c 1-2` == bv ) || ( `hostname | cut -c 1-2` == be ) ) then
115 set WRFREGDATAEM = /mmm/users/gill/WRF-data-EM
116 set WRFREGDATAEM = /mmm/users/gill/WRF_regression_data/processed
117 set WRFREGDATANMM = /glade/proj2/ral/RJNTB/dtc//WRF-data-NMM
118 else if ( ( `uname` == AIX ) && ( ( `hostname | cut -c 1-2` != bs ) && \
119 ( `hostname | cut -c 1-2` != bv ) && ( `hostname | cut -c 1-2` != be ) ) ) then
120 set WRFREGDATAEM = /nbns/meso/wx22tb/regression_tests/WRF-data-EM
121 set WRFREGDATANMM = /nbns/meso/wx22tb/regression_tests/WRF-data-NMM
122 else
123 if ( ( -d /users/gill/WRF-data-EM ) && ( -d /users/gill/WRF-data-NMM ) ) then
124 set WRFREGDATAEM = /users/gill/WRF-data-EM
125 set WRFREGDATANMM = /users/gill/WRF-data-NMM
126 else if ( ( -d /mmm/users/gill/WRF-data-EM ) && ( -d /mmm/users/gill/WRF-data-NMM ) ) then
127 set WRFREGDATAEM = /mmm/users/gill/WRF-data-EM
128 set WRFREGDATANMM = /glade/proj2/ral/RJNTB/dtc//WRF-data-NMM
129 else
130 echo "stick the WRF em and nmm data somewhere, and then fill in the shell vars"
131 echo "inside this script, you NEED WRFREGDATAEM and WRFREGDATANMM set"
132 exit ( 1 )
133 endif
134 endif
135 #DAVE###################################################
136 echo DAVE em data is located at $WRFREGDATAEM
137 ls -ls $WRFREGDATAEM
138 echo DAVE nmm data is located at $WRFREGDATANMM
139 ls -ls $WRFREGDATANMM
140 banner 1
141 #set ans = "$<"
142 #DAVE###################################################
144 if ( $#argv == 0 ) then
145 echo "Please enter either a date for cvs checkout. ex regtest.csh -D date"
146 echo " or a file name containing WRF. ex regtest.csh -f tarfile"
147 echo " or the -ftp flag for the script to pick code off anon ftp"
148 exit ( 2 )
149 endif
151 set theargs = 0
152 foreach a ( $argv )
153 if ( "$a" == "-D" ) then
155 rsh -n maple.mmm.ucar.edu w >& /dev/null
156 if ( $status ) then
157 echo "Cannot execute a remote shell on maple.mmm.ucar.edu, where the"
158 echo "WRF code resides."
159 echo "Please check that it is up and that you have permission to rsh"
160 echo "to this host. (Create a .rhosts file)."
161 ping -c 1 maple.mmm.ucar.edu
162 exit 2
163 endif
164 setenv CVSROOT maple.mmm.ucar.edu:/data3/mp/wrfhelp/WRF
166 set acquire_from = "cvs"
167 set thedate = $argv[2]
169 endif
171 if ( "$a" == "-f" ) then
173 set thefile = $argv[2]
174 # Check for absolute path, if not, make it absolute
175 echo $thefile | grep '^/' > /dev/null
176 if ( $status != 0 ) set thefile = `pwd`/$thefile
177 set acquire_from = "filearg"
179 endif
181 if ( "$a" == "-ftp" ) then
182 set acquire_from = "ftp"
183 echo "anon ftp temporarily disabled"
184 exit ( 3 )
185 endif
187 if ( "$a" == "-here" ) then
188 set acquire_from = "here"
189 endif
191 if ( "$a" == "-env" ) then
192 set acquire_from = "environment"
193 set thefile = $WRFREGFILE
194 endif
197 # Start recording everything - for debug purposes.
199 set echo
200 set date
202 # And to tell us how long we've spent on this whole regression test,
203 # we should remember when we started.
205 set start = ( `date` )
207 #####################################################################
209 # Initial set up values
211 # Is this a single domain regression test or is this nested. Well, a nested one
212 # is a bit special. It can only run on machines that have the WRF RSL_LITE-but-no-MPI
213 # option available.
215 set NESTED = TRUE
216 set NESTED = FALSE
218 if ( $NESTED == TRUE ) then
219 echo DOING a NESTED TEST
220 endif
222 # Use the adaptive time step option
224 set ADAPTIVE = TRUE
225 set ADAPTIVE = FALSE
227 if ( $ADAPTIVE == TRUE ) then
228 set STEP_TO_OUTPUT_TIME = .TRUE.
229 set USE_ADAPTIVE_TIME_STEP = .TRUE.
230 else
231 set STEP_TO_OUTPUT_TIME = .FALSE.
232 set USE_ADAPTIVE_TIME_STEP = .FALSE.
233 endif
235 # We can choose to do grid and obs nudging tests.
237 set FDDA = TRUE
238 set FDDA = FALSE
240 set FDDA2 = TRUE
241 set FDDA2 = FALSE
243 if ( $FDDA2 == TRUE ) then
244 set FDDA = TRUE
245 endif
247 # The default floating point precision is either 4 bytes or 8 bytes.
248 # We assume that it is 4 (or the default for the architecture) unless
249 # REAL8 is set to TRUE.
251 set REAL8 = TRUE
252 set REAL8 = FALSE
254 # Are we shooting for a bit-for-bit run (serial vs OpenMP, serial vs MPI), or not?
255 # If you want to do a performance-only run, the forecasts are still short, but you
256 # get to insure that the optimized code builds and runs.
258 set REG_TYPE = OPTIMIZED
259 set REG_TYPE = BIT4BIT
261 # For a Mac/Intel, we can run either g95 or PGI.
263 if ( `uname` == Darwin ) then
264 set LINUX_COMP = G95
265 set LINUX_COMP = PGI
266 endif
268 # We can choose to do a global test
270 if ( $NESTED != TRUE ) then
271 set GLOBAL = TRUE
272 set GLOBAL = FALSE
273 else if ( $NESTED == TRUE ) then
274 set GLOBAL = FALSE
275 endif
277 # Is this a WRF chem test?
278 # if CHEM = TRUE, then chemistry run
279 # if KPP = TRUE, then chemistry with KPP run (CHEM set to true)
281 if ( $NESTED != TRUE ) then
282 set KPP = TRUE
283 set KPP = FALSE
284 set CHEM = TRUE
285 set CHEM = FALSE
286 if ( $KPP == TRUE ) then
287 set CHEM = TRUE
288 endif
289 else if ( $NESTED == TRUE ) then
290 set CHEM = FALSE
291 set KPP = FALSE
292 endif
293 if ( $CHEM == TRUE ) then
294 setenv WRF_CHEM 1
295 else if ( $CHEM == FALSE ) then
296 setenv WRF_CHEM 0
297 endif
298 if ( $KPP == TRUE ) then
299 setenv WRF_KPP 1
300 setenv FLEX_LIB_DIR /usr/local/lib
301 set CHEM_OPT = 104
302 else if ( $KPP == FALSE ) then
303 setenv WRF_KPP 0
304 setenv FLEX_LIB_DIR
305 set CHEM_OPT =
306 endif
308 # For the real data case, we can run either one of two data cases. If this is
309 # a chemistry run, we are forced to use that data.
311 set dataset = jun01
312 set dataset = jan00
313 if ( $CHEM == TRUE ) then
314 set dataset = chem
315 endif
316 if ( $GLOBAL == TRUE ) then
317 set dataset = global
318 endif
320 # Yet another local variable to change the name of where the data is located.
322 set thedataem = ${WRFREGDATAEM}/${dataset}
323 set thedatanmm = $WRFREGDATANMM
325 # A separately installed version of the latest ESMF library (NOT the
326 # ESMF library included in the WRF tarfile) can be tested by setting
327 # "ESMF_LIB" to "TRUE" below. This test is not supported on all
328 # machines.
330 set ESMF_LIB = TRUE
331 set ESMF_LIB = FALSE
333 # serial and OMP are not tested with ESMF so always start with env vars cleared
334 unsetenv ESMFLIB
335 unsetenv ESMFINC
337 if ( $ESMF_LIB == TRUE ) then
338 if ( ( `uname` == AIX ) && ( ( `hostname | cut -c 1-2` == bv ) || ( `hostname | cut -c 1-2` == be ) ) ) then
339 echo "A separately installed version of the latest ESMF library"
340 echo "(NOT the ESMF library included in the WRF tarfile) will"
341 echo "be used for MPI tests"
342 setenv OBJECT_MODE 64
343 # set ESMFLIBSAVE = /home/bluevista/hender/esmf/esmf_2_2_2r/lib/libO/AIX.default.64.mpi.default
344 # set ESMFINCSAVE = /home/bluevista/hender/esmf/esmf_2_2_2r/mod/modO/AIX.default.64.mpi.default
345 setenv ESMF_DIR /mmm/users/michalak/esmf
346 setenv ESMF_BOPT g
347 setenv ESMF_ABI 64
348 setenv ESMF_INSTALL_PREFIX $ESMF_DIR/../esmf_install
349 setenv ESMFLIB $ESMF_INSTALL_PREFIX/lib/libg/AIX.default.64.mpi.default
350 setenv ESMFINC $ESMF_INSTALL_PREFIX/mod/modg/AIX.default.64.mpi.default
351 set ESMFLIBSAVE = $ESMFLIB
352 set ESMFINCSAVE = $ESMFINC
353 echo "Using ESMFLIB = ${ESMFLIBSAVE}"
354 echo "Using ESMFINC = ${ESMFINCSAVE}"
355 else
356 echo "Only the ESMF library included in the WRF tarfile is"
357 echo "tested on this machine"
358 exit ( 3 )
359 endif
360 if ( $NESTED == TRUE ) then
361 echo "The ESMF library does not work with nesting."
362 exit ( 3 )
363 endif
364 endif
366 # A single WRF output "quilt" server can be tested by setting "QUILT" to
367 # "TRUE" below. At the moment, testing of I/O quilt servers is not supported
368 # on all machines.
370 set QUILT = TRUE
371 set QUILT = FALSE
373 if ( $QUILT == TRUE ) then
374 echo "One WRF output quilt server will be used for some tests"
375 endif
377 # Baseline data sets can be generated and archived or compared against.
378 # - To generate and archive, set GENERATE_BASELINE to a pathname that can
379 # be created by this script via "mkdir -p $GENERATE_BASELINE". This
380 # directory must not already exist.
381 # Set GENERATE_BASELINE = FALSE to avoid baseline generation.
382 # - To compare with a previously archived baseline, set COMPARE_BASELINE
383 # to an existing directory that contains an archived baseline.
384 # Set COMPARE_BASELINE = FALSE to avoid baseline comparison.
385 set GENERATE_BASELINE = FALSE
386 set COMPARE_BASELINE = FALSE
388 # Baseline generation and comparison are only done when BIT4BIT is set.
389 if ( $GENERATE_BASELINE != FALSE ) then
390 if ( $REG_TYPE != BIT4BIT ) then
391 echo "ERROR: Baseline generation can only be done during BIT4BIT tests."
392 exit ( 3 )
393 endif
394 if ( -d $GENERATE_BASELINE ) then
395 echo "ERROR: Baseline directory ${GENERATE_BASELINE} already exists."
396 exit ( 3 )
397 else
398 # Archive serial output file to baseline
399 mkdir -p $GENERATE_BASELINE || ( echo "ERROR: cannot mkdir ${GENERATE_BASELINE}"; exit 3 )
400 endif
401 endif
402 if ( $COMPARE_BASELINE != FALSE ) then
403 if ( $REG_TYPE != BIT4BIT ) then
404 echo "Baseline comparison can only be done during BIT4BIT tests."
405 exit ( 3 )
406 endif
407 if ( ! -d $COMPARE_BASELINE ) then
408 echo "${0}: ERROR: Baseline directory ${COMPARE_BASELINE} does not exist"
409 exit ( 3 )
410 endif
411 endif
413 # Set the input/output format type (currently 1, 2 or 5 OK).
414 # Binary NetCDF PHDF, IBM GriB, history only
415 # 1 2 3 4 5
417 set IO_FORM = 2
418 set IO_FORM_NAME = ( io_bin io_netcdf io_dummy io_phdf5 io_grib1 )
419 set IO_FORM_WHICH =( IO IO IO IO O )
421 # There is a breakdown of cores to test depending on the various
422 # options that the user is testing.
423 # nested: cannot test NMM
424 # rsl_lite: cannot test anything with y periodic bc
425 # chem: em_real only
426 # esmf_lib: cannot test NMM
427 # grib output: cannot test NMM
429 if ( $NESTED == TRUE ) then
430 set CORES = ( em_real em_b_wave em_quarter_ss )
431 else if ( $NESTED != TRUE ) then
432 set CORES = ( em_real em_b_wave em_quarter_ss nmm_real )
433 set CORES = ( nmm_real )
434 if ( $CHEM == TRUE ) then
435 set CORES = ( em_real em_real )
436 endif
437 if ( $GLOBAL == TRUE ) then
438 set CORES = ( em_real )
439 endif
440 if ( $ADAPTIVE == TRUE ) then
441 set CORES = ( em_real )
442 endif
443 if ( $ESMF_LIB == TRUE ) then
444 set CORES = ( em_real em_b_wave em_quarter_ss )
445 endif
446 if ( $IO_FORM_NAME[$IO_FORM] == io_grib1 ) then
447 set CORES = ( em_real em_b_wave em_quarter_ss )
448 endif
449 if ( $FDDA == TRUE ) then
450 set CORES = ( em_real )
451 endif
452 endif
454 # The b_wave case has binary input (4-byte only), the nmm
455 # core has raw MPI calls, skip them if we are doing real*8 floats.
457 if ( $REAL8 == TRUE ) then
458 set CORES = ( em_real em_quarter_ss )
459 endif
461 if ( ( $CHEM != TRUE ) && ( $FDDA != TRUE ) && ( $NESTED != TRUE ) && ( $REAL8 != TRUE ) && ( $GLOBAL != TRUE ) ) then
462 set PHYSOPTS = ( 1 2 3 4 5 6 7 )
463 else if ( ( $CHEM != TRUE ) && ( $FDDA != TRUE ) && ( ( $NESTED == TRUE ) || ( $REAL8 == TRUE ) || ( $GLOBAL == TRUE ) ) ) then
464 set PHYSOPTS = ( 1 2 3 4 5 6 )
465 else if ( ( $CHEM != TRUE ) && ( $FDDA == TRUE ) ) then
466 if ( $FDDA2 == TRUE ) then
467 set PHYSOPTS_FDDA = BOTH
468 else
469 set PHYSOPTS_FDDA = GRID
470 endif
471 if ( $PHYSOPTS_FDDA == GRID ) then
472 set PHYSOPTS = ( 1 )
473 else
474 set PHYSOPTS = ( 1 2 3 )
475 endif
476 else if ( $CHEM == TRUE ) then
477 set PHYSOPTS = ( 1 2 3 4 5 6 )
478 endif
480 ##LPC
481 ##LPC --- run just nmm test
482 ##LPC
483 set CORES = (nmm_real)
485 # This is selecting the ideal physics options - mostly selecting BC options.
486 # With no nesting, run all three ideal physics options.
488 if ( $NESTED == TRUE ) then
489 set Max_Ideal_Physics_Options = 2
490 else if ( $NESTED != TRUE ) then
491 set Max_Ideal_Physics_Options = 3
492 endif
494 set CUR_DIR = `pwd`
496 # How many domains to run (nest tests). Only em_real and ideals use this.
497 # The max is 3 due to the number of columns in the namelist that are
498 # currently filled in.
500 if ( $NESTED == TRUE ) then
501 if ( $dataset == jan00 ) then
502 cat >! dom_real << EOF
503 time_step = 180,
504 time_step_fract_num = 0,
505 time_step_fract_den = 1,
506 max_dom = 2,
507 s_we = 1, 1, 1,
508 e_we = 74, 31, 31,
509 s_sn = 1, 1, 1,
510 e_sn = 61, 31, 31,
511 s_vert = 1, 1, 1,
512 e_vert = 28, 28, 28,
513 dx = 30000, 10000, 3333.333333,
514 dy = 30000, 10000, 3333.333333,
515 grid_id = 1, 2, 3,
516 parent_id = 0, 1, 2,
517 i_parent_start = 0, 31, 11,
518 j_parent_start = 0, 17, 11,
519 parent_grid_ratio = 1, 3, 3,
520 parent_time_step_ratio = 1, 3, 3,
521 feedback = 1,
522 smooth_option = 0
523 num_moves = 3
524 move_id = 2 , 2 , 2
525 move_interval = 3 , 6 , 9
526 move_cd_x = 1 , 1 , 1
527 move_cd_y = 1 , 1 , 1
528 use_adaptive_time_step = $USE_ADAPTIVE_TIME_STEP
529 step_to_output_time = $STEP_TO_OUTPUT_TIME
531 else if ( $dataset == jun01 ) then
532 cat >! dom_real << EOF
533 time_step = 60,
534 time_step_fract_num = 0,
535 time_step_fract_den = 1,
536 max_dom = 2,
537 s_we = 1, 1, 1,
538 e_we = 91, 31, 31,
539 s_sn = 1, 1, 1,
540 e_sn = 82, 31, 31,
541 s_vert = 1, 1, 1,
542 e_vert = 28, 28, 28,
543 dx = 10000, 3333.333333, 1111.111111,
544 dy = 10000, 3333.333333, 1111.111111,
545 grid_id = 1, 2, 3,
546 parent_id = 0, 1, 2,
547 i_parent_start = 0, 30, 11,
548 j_parent_start = 0, 20, 11,
549 parent_grid_ratio = 1, 3, 3,
550 parent_time_step_ratio = 1, 3, 3,
551 feedback = 1,
552 smooth_option = 0
553 num_moves = 3
554 move_id = 2 , 2 , 2
555 move_interval = 1 , 2 , 3
556 move_cd_x = 1 , 1 , 1
557 move_cd_y = 1 , 1 , 1
558 use_adaptive_time_step = $USE_ADAPTIVE_TIME_STEP
559 step_to_output_time = $STEP_TO_OUTPUT_TIME
561 endif
562 cat >! dom_ideal << EOF
563 max_dom = 2,
565 else if ( $NESTED != TRUE ) then
566 if ( $dataset == jan00 ) then
567 cat >! dom_real << EOF
568 time_step = 180,
569 time_step_fract_num = 0,
570 time_step_fract_den = 1,
571 max_dom = 1,
572 s_we = 1, 1, 1,
573 e_we = 74, 31, 31,
574 s_sn = 1, 1, 1,
575 e_sn = 61, 31, 31,
576 s_vert = 1, 1, 1,
577 e_vert = 28, 28, 28,
578 dx = 30000, 10000, 3333,
579 dy = 30000, 10000, 3333,
580 grid_id = 1, 2, 3,
581 parent_id = 0, 1, 2,
582 i_parent_start = 0, 31, 30,
583 j_parent_start = 0, 17, 30,
584 parent_grid_ratio = 1, 3, 3,
585 parent_time_step_ratio = 1, 3, 3,
586 feedback = 1,
587 smooth_option = 0
588 use_adaptive_time_step = $USE_ADAPTIVE_TIME_STEP
589 step_to_output_time = $STEP_TO_OUTPUT_TIME
591 else if ( $dataset == jun01 ) then
592 cat >! dom_real << EOF
593 time_step = 60,
594 time_step_fract_num = 0,
595 time_step_fract_den = 1,
596 max_dom = 1,
597 s_we = 1, 1, 1,
598 e_we = 91, 31, 31,
599 s_sn = 1, 1, 1,
600 e_sn = 82, 31, 31,
601 s_vert = 1, 1, 1,
602 e_vert = 28, 28, 28,
603 dx = 10000, 3333.333333, 1111.111111,
604 dy = 10000, 3333.333333, 1111.111111,
605 grid_id = 1, 2, 3,
606 parent_id = 0, 1, 2,
607 i_parent_start = 0, 30, 11,
608 j_parent_start = 0, 20, 11,
609 parent_grid_ratio = 1, 3, 3,
610 parent_time_step_ratio = 1, 3, 3,
611 feedback = 1,
612 smooth_option = 0
613 use_adaptive_time_step = $USE_ADAPTIVE_TIME_STEP
614 step_to_output_time = $STEP_TO_OUTPUT_TIME
616 else if ( $dataset == global ) then
617 cat >! dom_real << EOF
618 time_step = 600
619 time_step_fract_num = 00
620 time_step_fract_den = 112
621 max_dom = 1,
622 s_we = 1, 1, 1,
623 e_we = 65, 41, 41,
624 s_sn = 1, 1, 1,
625 e_sn = 33, 81, 81,
626 s_vert = 1, 1, 1,
627 e_vert = 41, 41, 41,
628 num_metgrid_levels = 27
629 dx = 625373.288,20000, 4000,
630 dy = 625373.288,20000, 4000,
631 p_top_requested = 5000
632 grid_id = 1, 2, 3,
633 parent_id = 0, 1, 2,
634 i_parent_start = 0, 17, 17,
635 j_parent_start = 0, 33, 33,
636 parent_grid_ratio = 1, 5, 5,
637 parent_time_step_ratio = 1, 5, 5,
638 feedback = 1,
639 smooth_option = 00
641 endif
642 cat >! dom_ideal << EOF
643 max_dom = 1,
645 endif
647 # The em_real entire physics namelist. Change what you want.
649 cat >! phys_real_1 << EOF
650 mp_physics = 3, 3, 3,
651 ra_lw_physics = 1, 1, 1,
652 ra_sw_physics = 1, 1, 1,
653 radt = 30, 30, 30,
654 sf_sfclay_physics = 1, 1, 1,
655 sf_surface_physics = 1, 1, 1,
656 bl_pbl_physics = 1, 1, 1,
657 bldt = 0, 0, 0,
658 cu_physics = 1, 1, 0,
659 cudt = 5, 5, 5,
660 isfflx = 1,
661 ifsnow = 0,
662 icloud = 1,
663 surface_input_source = 1,
664 num_soil_layers = 5,
665 mp_zero_out = 0,
666 maxiens = 1,
667 maxens = 3,
668 maxens2 = 3,
669 maxens3 = 16,
670 ensdim = 144,
673 cat >! dyn_real_SAFE << EOF
674 moist_adv_opt = 0, 0, 0,
675 scalar_adv_opt = 0, 0, 0,
676 chem_adv_opt = 0, 0, 0,
677 tke_adv_opt = 0, 0, 0,
680 cat >! dyn_real_1 << EOF
681 moist_adv_opt = 1, 1, 1,
682 scalar_adv_opt = 0, 0, 0,
683 chem_adv_opt = 0, 0, 0,
684 tke_adv_opt = 0, 0, 0,
687 cat >! time_real_1 << EOF
688 auxinput1_inname = "met_em.d<domain>.<date>"
691 cat >! nest_real_1 << EOF
692 input_from_file = .true.,.false.,.false.
695 cat >! damp_real_1 << EOF
696 damp_opt = 0,
697 zdamp = 5000., 5000., 5000.,
698 dampcoef = 0.01, 0.01, 0.01
701 cat >! phys_real_2 << EOF
702 mp_physics = 4, 4, 4,
703 ra_lw_physics = 1, 1, 1,
704 ra_sw_physics = 1, 1, 1,
705 radt = 30, 30, 30,
706 sf_sfclay_physics = 2, 2, 2,
707 sf_surface_physics = 2, 2, 2,
708 bl_pbl_physics = 2, 2, 2,
709 bldt = 0, 0, 0,
710 cu_physics = 2, 2, 0,
711 cudt = 5, 5, 5,
712 slope_rad = 1, 1, 1,
713 topo_shading = 0, 0, 0,
714 isfflx = 1,
715 ifsnow = 0,
716 icloud = 1,
717 surface_input_source = 1,
718 num_soil_layers = 4,
719 mp_zero_out = 0,
720 maxiens = 1,
721 maxens = 3,
722 maxens2 = 3,
723 maxens3 = 16,
724 ensdim = 144,
727 cat >! dyn_real_2 << EOF
728 moist_adv_opt = 1, 1, 1,
729 scalar_adv_opt = 0, 0, 0,
730 chem_adv_opt = 0, 0, 0,
731 tke_adv_opt = 0, 0, 0,
734 if ( $GLOBAL == TRUE ) then
735 cp dyn_real_SAFE dyn_real_2
736 endif
738 cat >! time_real_2 << EOF
739 auxinput1_inname = "met_em.d<domain>.<date>"
742 cat >! nest_real_2 << EOF
743 input_from_file = .true.,.false.,.false.
746 cat >! damp_real_2 << EOF
747 damp_opt = 0,
748 zdamp = 5000., 5000., 5000.,
749 dampcoef = 0.01, 0.01, 0.01
752 cat >! phys_real_3 << EOF
753 mp_physics = 5, 5, 5,
754 ra_lw_physics = 1, 1, 1,
755 ra_sw_physics = 2, 2, 2,
756 radt = 30, 30, 30,
757 sf_sfclay_physics = 2, 2, 2,
758 sf_surface_physics = 3, 3, 3,
759 bl_pbl_physics = 2, 2, 2,
760 bldt = 0, 0, 0,
761 cu_physics = 3, 3, 0,
762 cudt = 5, 5, 5,
763 omlcall = 1,
764 oml_hml0 = 50,
765 oml_gamma = 0.14
766 isfflx = 1,
767 ifsnow = 0,
768 icloud = 1,
769 surface_input_source = 1,
770 num_soil_layers = 6,
771 mp_zero_out = 0,
772 maxiens = 1,
773 maxens = 3,
774 maxens2 = 3,
775 maxens3 = 16,
776 ensdim = 144,
779 cat >! dyn_real_3 << EOF
780 moist_adv_opt = 2, 2, 2,
781 scalar_adv_opt = 0, 0, 0,
782 chem_adv_opt = 0, 0, 0,
783 tke_adv_opt = 0, 0, 0,
786 cat >! time_real_3 << EOF
787 auxinput1_inname = "met_em.d<domain>.<date>"
790 cat >! nest_real_3 << EOF
791 input_from_file = .true.,.false.,.false.
794 cat >! damp_real_3 << EOF
795 damp_opt = 1,
796 zdamp = 5000., 5000., 5000.,
797 dampcoef = 0.01, 0.01, 0.01
800 cat >! phys_real_4 << EOF
801 mp_physics = 6, 6, 6,
802 ra_lw_physics = 1, 1, 1,
803 ra_sw_physics = 2, 2, 2,
804 radt = 30, 30, 30,
805 sf_sfclay_physics = 2, 2, 2,
806 sf_surface_physics = 2, 2, 2,
807 bl_pbl_physics = 2, 2, 2,
808 bldt = 0, 0, 0,
809 cu_physics = 5, 5, 0,
810 cudt = 5, 5, 5,
811 isfflx = 1,
812 ifsnow = 0,
813 icloud = 1,
814 sf_urban_physics = 1, 1, 1,
815 surface_input_source = 1,
816 num_soil_layers = 4,
817 mp_zero_out = 0,
818 maxiens = 1,
819 maxens = 3,
820 maxens2 = 3,
821 maxens3 = 16,
822 ensdim = 144,
825 cat >! dyn_real_4 << EOF
826 moist_adv_opt = 2, 2, 2,
827 scalar_adv_opt = 0, 0, 0,
828 chem_adv_opt = 0, 0, 0,
829 tke_adv_opt = 0, 0, 0,
832 cat >! time_real_4 << EOF
833 auxinput1_inname = "met_em.d<domain>.<date>"
836 cat >! nest_real_4 << EOF
837 input_from_file = .true.,.false.,.false.
840 cat >! damp_real_4 << EOF
841 damp_opt = 1,
842 zdamp = 5000., 5000., 5000.,
843 dampcoef = 0.01, 0.01, 0.01
846 cat >! phys_real_5 << EOF
847 mp_physics = 10, 10, 10,
848 ra_lw_physics = 1, 1, 1,
849 ra_sw_physics = 1, 1, 1,
850 radt = 30, 30, 30,
851 sf_sfclay_physics = 7, 7, 7,
852 sf_surface_physics = 1, 1, 1,
853 bl_pbl_physics = 7, 7, 7,
854 bldt = 0, 0, 0,
855 cu_physics = 99, 99, 0,
856 cudt = 0, 0, 0,
857 slope_rad = 1, 1, 1,
858 topo_shading = 0, 0, 0,
859 isfflx = 1,
860 ifsnow = 0,
861 icloud = 1,
862 sf_urban_physics = 1, 1, 1,
863 surface_input_source = 1,
864 num_soil_layers = 5,
865 mp_zero_out = 0,
866 maxiens = 1,
867 maxens = 3,
868 maxens2 = 3,
869 maxens3 = 16,
870 ensdim = 144,
871 levsiz = 59
872 paerlev = 29
873 cam_abs_freq_s = 21600
874 cam_abs_dim1 = 4
875 cam_abs_dim2 = 28
878 cat >! dyn_real_5 << EOF
879 moist_adv_opt = 2, 2, 2,
880 scalar_adv_opt = 0, 0, 0,
881 chem_adv_opt = 0, 0, 0,
882 tke_adv_opt = 0, 0, 0,
885 cat >! time_real_5 << EOF
886 auxinput1_inname = "met_em.d<domain>.<date>"
889 cat >! nest_real_5 << EOF
890 input_from_file = .true.,.false.,.false.
893 cat >! damp_real_5 << EOF
894 damp_opt = 3,
895 zdamp = 5000., 5000., 5000.,
896 dampcoef = 0.05, 0.05, 0.05
899 cat >! phys_real_6 << EOF
900 mp_physics = 7, 7, 7,
901 ra_lw_physics = 1, 1, 1,
902 ra_sw_physics = 2, 2, 2,
903 radt = 30, 30, 30,
904 sf_sfclay_physics = 7, 7, 7,
905 sf_surface_physics = 1, 1, 1,
906 bl_pbl_physics = 7, 7, 7,
907 bldt = 0, 0, 0,
908 cu_physics = 1, 1, 0,
909 cudt = 0, 0, 0,
910 omlcall = 1,
911 oml_hml0 = 50,
912 oml_gamma = 0.14
913 isfflx = 1,
914 ifsnow = 0,
915 icloud = 1,
916 sf_urban_physics = 1, 1, 1,
917 surface_input_source = 1,
918 num_soil_layers = 5,
919 mp_zero_out = 0,
920 maxiens = 1,
921 maxens = 3,
922 maxens2 = 3,
923 maxens3 = 16,
924 ensdim = 144,
925 levsiz = 59
926 paerlev = 29
927 cam_abs_freq_s = 21600
928 cam_abs_dim1 = 4
929 cam_abs_dim2 = 28
932 cat >! dyn_real_6 << EOF
933 moist_adv_opt = 0, 0, 0,
934 scalar_adv_opt = 0, 0, 0,
935 chem_adv_opt = 0, 0, 0,
936 tke_adv_opt = 0, 0, 0,
939 cat >! time_real_6 << EOF
940 auxinput1_inname = "met_em.d<domain>.<date>"
943 cat >! nest_real_6 << EOF
944 input_from_file = .true.,.false.,.false.
947 cat >! damp_real_6 << EOF
948 damp_opt = 3,
949 zdamp = 5000., 5000., 5000.,
950 dampcoef = 0.05, 0.05, 0.05
953 cat >! phys_real_7 << EOF
954 mp_physics = 8, 8, 8,
955 ra_lw_physics = 3, 3, 3,
956 ra_sw_physics = 3, 3, 3,
957 radt = 30, 30, 30,
958 sf_sfclay_physics = 2, 2, 2,
959 sf_surface_physics = 2, 2, 2,
960 bl_pbl_physics = 2, 2, 2,
961 bldt = 0, 0, 0,
962 cu_physics = 99, 99, 0,
963 cudt = 5, 5, 5,
964 isfflx = 1,
965 ifsnow = 0,
966 icloud = 1,
967 sf_urban_physics = 1, 1, 1,
968 surface_input_source = 1,
969 num_soil_layers = 4,
970 mp_zero_out = 0,
971 maxiens = 1,
972 maxens = 3,
973 maxens2 = 3,
974 maxens3 = 16,
975 ensdim = 144,
976 levsiz = 59
977 paerlev = 29
978 cam_abs_freq_s = 21600
979 cam_abs_dim1 = 4
980 cam_abs_dim2 = 28
983 cat >! dyn_real_7 << EOF
984 moist_adv_opt = 0, 0, 0,
985 scalar_adv_opt = 0, 0, 0,
986 chem_adv_opt = 0, 0, 0,
987 tke_adv_opt = 0, 0, 0,
990 cat >! time_real_7 << EOF
991 auxinput1_inname = "met_em.d<domain>.<date>"
994 cat >! nest_real_7 << EOF
995 input_from_file = .true.,.false.,.false.
998 cat >! damp_real_7 << EOF
999 damp_opt = 3,
1000 zdamp = 5000., 5000., 5000.,
1001 dampcoef = 0.05, 0.05, 0.05
1004 if ( $GLOBAL == TRUE ) then
1005 sed -e 's/ cam_abs_dim2 *= [0-9][0-9]/ cam_abs_dim2 = 41/g' phys_real_5 >! phys_foo
1006 mv phys_foo phys_real_7
1007 cp dyn_real_SAFE dyn_real_1
1008 cp dyn_real_SAFE dyn_real_2
1009 cp dyn_real_SAFE dyn_real_3
1010 cp dyn_real_SAFE dyn_real_4
1011 cp dyn_real_SAFE dyn_real_5
1012 cp dyn_real_SAFE dyn_real_6
1013 cp dyn_real_SAFE dyn_real_7
1014 endif
1016 cat >! fdda_real_1 << EOF
1017 grid_fdda = 1, 1, 1,
1018 gfdda_inname = "wrffdda_d<domain>",
1019 gfdda_end_h = 24, 24, 24,
1020 gfdda_interval_m = 360, 360, 360,
1021 fgdt = 0, 0, 0,
1022 if_no_pbl_nudging_uv = 0, 0, 1,
1023 if_no_pbl_nudging_t = 0, 0, 1,
1024 if_no_pbl_nudging_q = 0, 0, 1,
1025 if_zfac_uv = 0, 0, 1,
1026 k_zfac_uv = 10, 10, 1,
1027 if_zfac_t = 0, 0, 1,
1028 k_zfac_t = 10, 10, 1,
1029 if_zfac_q = 0, 0, 1,
1030 k_zfac_q = 10, 10, 1,
1031 guv = 0.0003, 0.0003, 0.0003,
1032 gt = 0.0003, 0.0003, 0.0003,
1033 gq = 0.0003, 0.0003, 0.0003,
1034 if_ramping = 1,
1035 dtramp_min = 360.0,
1036 io_form_gfdda = 2,
1039 cat >! fdda_real_time_1 << EOF
1042 cat >! fdda_real_2 << EOF
1043 obs_nudge_opt = 1,1,1,1,1
1044 max_obs = 150000,
1045 obs_nudge_wind = 1,1,1,1,1
1046 obs_coef_wind = 6.E-4,6.E-4,6.E-4,6.E-4,6.E-4
1047 obs_nudge_temp = 1,1,1,1,1
1048 obs_coef_temp = 6.E-4,6.E-4,6.E-4,6.E-4,6.E-4
1049 obs_nudge_mois = 1,1,1,1,1
1050 obs_coef_mois = 6.E-4,6.E-4,6.E-4,6.E-4,6.E-4
1051 obs_rinxy = 240.,240.,180.,180,180
1052 obs_rinsig = 0.1,
1053 obs_twindo = 40.
1054 obs_npfi = 10,
1055 obs_ionf = 2,
1056 obs_idynin = 0,
1057 obs_dtramp = 40.,
1058 obs_ipf_errob = .true.
1059 obs_ipf_nudob = .true.
1060 obs_ipf_in4dob = .true.
1063 cat >! fdda_real_time_2 << EOF
1064 auxinput11_interval_s = 180
1065 auxinput11_end_h = 6
1068 cat >! fdda_real_3 << EOF
1069 grid_fdda = 1, 1, 1,
1070 gfdda_inname = "wrffdda_d<domain>",
1071 gfdda_end_h = 24, 24, 24,
1072 gfdda_interval_m = 360, 360, 360,
1073 fgdt = 0, 0, 0,
1074 if_no_pbl_nudging_uv = 0, 0, 1,
1075 if_no_pbl_nudging_t = 0, 0, 1,
1076 if_no_pbl_nudging_q = 0, 0, 1,
1077 if_zfac_uv = 0, 0, 1,
1078 k_zfac_uv = 10, 10, 1,
1079 if_zfac_t = 0, 0, 1,
1080 k_zfac_t = 10, 10, 1,
1081 if_zfac_q = 0, 0, 1,
1082 k_zfac_q = 10, 10, 1,
1083 guv = 0.0003, 0.0003, 0.0003,
1084 gt = 0.0003, 0.0003, 0.0003,
1085 gq = 0.0003, 0.0003, 0.0003,
1086 if_ramping = 1,
1087 dtramp_min = 360.0,
1088 io_form_gfdda = 2,
1089 obs_nudge_opt = 1,1,1,1,1
1090 max_obs = 150000,
1091 obs_nudge_wind = 1,1,1,1,1
1092 obs_coef_wind = 6.E-4,6.E-4,6.E-4,6.E-4,6.E-4
1093 obs_nudge_temp = 1,1,1,1,1
1094 obs_coef_temp = 6.E-4,6.E-4,6.E-4,6.E-4,6.E-4
1095 obs_nudge_mois = 1,1,1,1,1
1096 obs_coef_mois = 6.E-4,6.E-4,6.E-4,6.E-4,6.E-4
1097 obs_rinxy = 240.,240.,180.,180,180
1098 obs_rinsig = 0.1,
1099 obs_twindo = 40.
1100 obs_npfi = 10,
1101 obs_ionf = 2,
1102 obs_idynin = 0,
1103 obs_dtramp = 40.,
1104 obs_ipf_errob = .true.
1105 obs_ipf_nudob = .true.
1106 obs_ipf_in4dob = .true.
1109 cat >! fdda_real_time_3 << EOF
1110 auxinput11_interval_s = 180
1111 auxinput11_end_h = 6
1114 # Tested options for ideal case em_b_wave. Modifying these
1115 # parameters is acceptable. Adding to these requires changes
1116 # to the ideal namelist build below.
1118 cat >! phys_b_wave_1a << EOF
1119 diff_opt = 1,
1120 km_opt = 1,
1121 damp_opt = 0,
1123 cat >! phys_b_wave_1b << EOF
1124 mp_physics = 1, 1, 1,
1126 cat >! phys_b_wave_1c << EOF
1127 non_hydrostatic = .true., .true., .true.,
1129 cat >! phys_b_wave_1d << EOF
1130 input_from_file = .true.,.false.,.false.
1133 cat >! phys_b_wave_2a << EOF
1134 diff_opt = 1,
1135 km_opt = 1,
1136 damp_opt = 0,
1138 cat >! phys_b_wave_2b << EOF
1139 mp_physics = 1, 1, 1,
1141 cat >! phys_b_wave_2c << EOF
1142 non_hydrostatic = .false., .false., .false.,
1144 cat >! phys_b_wave_2d << EOF
1145 input_from_file = .true.,.false.,.false.
1148 cat >! phys_b_wave_3a << EOF
1149 diff_opt = 1,
1150 km_opt = 1,
1151 damp_opt = 0,
1153 cat >! phys_b_wave_3b << EOF
1154 mp_physics = 2, 2, 2,
1156 cat >! phys_b_wave_3c << EOF
1157 non_hydrostatic = .false., .false., .false.,
1159 cat >! phys_b_wave_3d << EOF
1160 input_from_file = .true.,.false.,.false.
1163 # Tested options for ideal case em_quarter_ss. Modifying these
1164 # parameters is acceptable. Adding to these requires changes
1165 # to the ideal namelist build below.
1167 cat >! phys_quarter_ss_1a << EOF
1168 diff_opt = 1,
1169 km_opt = 1,
1170 damp_opt = 0,
1172 cat >! phys_quarter_ss_1b << EOF
1173 mp_physics = 1, 1, 1,
1175 cat >! phys_quarter_ss_1c << EOF
1176 moist_adv_opt = 1, 1, 1,
1177 scalar_adv_opt = 1, 1, 1,
1178 chem_adv_opt = 1, 1, 1,
1179 tke_adv_opt = 1, 1, 1,
1180 non_hydrostatic = .true., .true., .true.,
1182 cat >! phys_quarter_ss_1d << EOF
1183 input_from_file = .true.,.false.,.false.
1185 cat >! phys_quarter_ss_1e << EOF
1186 periodic_x = .false.,.false.,.false.,
1187 open_xs = .true., .false.,.false.,
1188 open_xe = .true., .false.,.false.,
1189 periodic_y = .false.,.false.,.false.,
1190 open_ys = .true., .false.,.false.,
1191 open_ye = .true., .false.,.false.,
1193 cat >! phys_quarter_ss_1f << EOF
1194 sf_sfclay_physics = 0, 0, 0,
1197 cat >! phys_quarter_ss_2a << EOF
1198 diff_opt = 2,
1199 km_opt = 2,
1200 damp_opt = 1,
1202 cat >! phys_quarter_ss_2b << EOF
1203 mp_physics = 1, 1, 1,
1205 cat >! phys_quarter_ss_2c << EOF
1206 moist_adv_opt = 2, 2, 2,
1207 scalar_adv_opt = 2, 2, 2,
1208 chem_adv_opt = 2, 2, 2,
1209 tke_adv_opt = 2, 2, 2,
1210 non_hydrostatic = .true., .true., .true.,
1212 cat >! phys_quarter_ss_2d << EOF
1213 input_from_file = .true.,.false.,.false.
1215 cat >! phys_quarter_ss_2e << EOF
1216 periodic_x = .false.,.false.,.false.,
1217 open_xs = .true., .false.,.false.,
1218 open_xe = .true., .false.,.false.,
1219 periodic_y = .false.,.false.,.false.,
1220 open_ys = .true., .false.,.false.,
1221 open_ye = .true., .false.,.false.,
1223 cat >! phys_quarter_ss_2f << EOF
1224 sf_sfclay_physics = 1, 1, 1,
1227 cat >! phys_quarter_ss_3a << EOF
1228 diff_opt = 2,
1229 km_opt = 3,
1230 damp_opt = 1,
1232 cat >! phys_quarter_ss_3b << EOF
1233 mp_physics = 2, 2, 2,
1235 cat >! phys_quarter_ss_3c << EOF
1236 moist_adv_opt = 1, 1, 1,
1237 scalar_adv_opt = 1, 1, 1,
1238 chem_adv_opt = 1, 1, 1,
1239 tke_adv_opt = 1, 1, 1,
1240 non_hydrostatic = .false., .false., .false.,
1242 cat >! phys_quarter_ss_3d << EOF
1243 input_from_file = .true.,.false.,.false.
1245 cat >! phys_quarter_ss_3e << EOF
1246 periodic_x = .true., .false.,.false.,
1247 open_xs = .false.,.false.,.false.,
1248 open_xe = .false.,.false.,.false.,
1249 periodic_y = .true., .false.,.false.,
1250 open_ys = .false.,.false.,.false.,
1251 open_ye = .false.,.false.,.false.,
1253 cat >! phys_quarter_ss_3f << EOF
1254 sf_sfclay_physics = 1, 1, 1,
1257 if ( $IO_FORM_WHICH[$IO_FORM] == IO ) then
1258 cat >! io_format << EOF
1259 io_form_history = $IO_FORM
1260 io_form_restart = $IO_FORM
1261 io_form_input = $IO_FORM
1262 io_form_boundary = $IO_FORM
1264 else if ( $IO_FORM_WHICH[$IO_FORM] == I ) then
1265 cat >! io_format << EOF
1266 io_form_history = 2
1267 io_form_restart = 2
1268 io_form_input = $IO_FORM
1269 io_form_boundary = $IO_FORM
1271 else if ( $IO_FORM_WHICH[$IO_FORM] == O ) then
1272 cat >! io_format << EOF
1273 io_form_history = $IO_FORM
1274 io_form_restart = 2
1275 io_form_input = 2
1276 io_form_boundary = 2
1278 endif
1281 if ( $dataset == jun01 ) then
1282 set filetag_real=2001-06-11_12:00:00
1283 else if ( $dataset == jan00 ) then
1284 set filetag_real=2000-01-24_12:00:00
1285 else if ( $dataset == chem ) then
1286 set filetag_real = ( 2006-04-06_00:00:00 2006-04-06_12:00:00 )
1287 else if ( $dataset == global ) then
1288 set filetag_real=2008-01-02_12:00:00
1289 endif
1291 set filetag_ideal=0001-01-01_00:00:00
1292 #DAVE###################################################
1293 echo did phys, set date to $filetag_real
1294 banner 2
1295 #set ans = "$<"
1296 #DAVE###################################################
1298 #####################################################################
1300 # Set up info for particular architectures
1302 set ARCH = ( `uname` )
1304 set ZAP_SERIAL = FALSE
1305 set ZAP_OPENMP = FALSE
1306 set SERIALRUNCOMMAND =
1307 set OMPRUNCOMMAND =
1308 set MPIRUNCOMMANDPOST =
1310 touch version_info
1311 if ( $ARCH[1] == AIX ) then
1312 set DEF_DIR = $home
1313 set TMPDIR = /ptmp/$user
1314 # keep stuff out of $HOME and /ptmp/$USER
1315 # this allows multiple regressions tests to run simultaneously
1316 # extend this to other machines later
1317 if ( ( `hostname | cut -c 1-2` == bs ) && ( ! $?LOADL_JOB_NAME ) ) then
1318 echo "${0}: ERROR:: This batch script must be submitted via"
1319 echo "${0}: LoadLeveler on an AIX machine\!"
1320 exit
1321 else if ( `hostname | cut -c 1-2` == bs ) then
1322 set job_id = `echo ${LOADL_JOB_NAME} | cut -f2 -d'.'`
1323 set DEF_DIR = /ptmp/$user/wrf_regression.${job_id}
1324 set TMPDIR = $DEF_DIR
1325 if ( -d $DEF_DIR ) then
1326 echo "${0}: ERROR:: Directory ${DEF_DIR} exists, please remove it"
1327 exit ( 1 )
1328 else
1329 mkdir -p $DEF_DIR
1330 echo "See ${DEF_DIR}/wrftest.output and other files in ${DEF_DIR} for test results"
1331 endif
1332 set CUR_DIR = ${LOADL_STEP_INITDIR}
1333 else if ( ( `hostname | cut -c 1-2` == bv ) || ( `hostname | cut -c 1-2` == be ) ) then
1334 set job_id = $LSB_JOBID
1335 set DEF_DIR = /ptmp/$user/wrf_regression.${job_id}
1336 set TMPDIR = $DEF_DIR
1337 if ( -d $DEF_DIR ) then
1338 echo "${0}: ERROR:: Directory ${DEF_DIR} exists, please remove it"
1339 exit ( 1 )
1340 else
1341 mkdir -p $DEF_DIR
1342 echo "See ${DEF_DIR}/wrftest.output and other files in ${DEF_DIR} for test results"
1343 endif
1344 else if ( ( ( `hostname | cut -c 1-2` != be ) && ( `hostname | cut -c 1-2` != bv ) ) && ( ! $?LOADL_JOB_NAME ) ) then
1345 echo "${0}: ERROR:: This batch script must be submitted via"
1346 echo "${0}: LoadLeveler on an AIX machine\!"
1347 exit
1348 else if ( ( `hostname | cut -c 1-2` != be ) && ( `hostname | cut -c 1-2` != bv ) ) then
1349 set job_id = `echo ${LOADL_JOB_NAME} | cut -f2 -d'.'`
1350 set DEF_DIR = /ptmp/$user/wrf_regression.${job_id}
1351 set TMPDIR = $DEF_DIR
1352 if ( -d $DEF_DIR ) then
1353 echo "${0}: ERROR:: Directory ${DEF_DIR} exists, please remove it"
1354 exit ( 1 )
1355 else
1356 mkdir -p $DEF_DIR
1357 echo "See ${DEF_DIR}/wrftest.output and other files in ${DEF_DIR} for test results"
1358 endif
1359 set CUR_DIR = ${LOADL_STEP_INITDIR}
1360 endif
1361 if ( ! -d $TMPDIR ) mkdir $TMPDIR
1362 set MAIL = /usr/bin/mailx
1363 set COMPOPTS = ( 1 2 3 )
1364 set COMPOPTS_NO_NEST = 0
1365 set COMPOPTS_NEST_STATIC = 1
1366 set COMPOPTS_NEST_PRESCRIBED = 2
1367 set Num_Procs = 4
1368 set OPENMP = $Num_Procs
1369 setenv MP_PROCS $Num_Procs
1370 setenv MP_RMPOOL 1
1371 if ( `hostname | cut -c 1-2` == bs ) then
1372 set MPIRUNCOMMAND = poe
1373 else if ( `hostname | cut -c 1-2` == bv ) then
1374 set MPIRUNCOMMAND = mpirun.lsf
1375 else if ( `hostname | cut -c 1-2` == be ) then
1376 set MPIRUNCOMMAND = /contrib/mpiruns/be/mpirun.lsf
1377 else if ( ( `hostname | cut -c 1-2` != bs ) && \
1378 ( `hostname | cut -c 1-2` != bv ) && ( `hostname | cut -c 1-2` != be ) ) then
1379 set MPIRUNCOMMAND = poe
1380 endif
1381 if ( $CHEM == TRUE ) then
1382 set ZAP_OPENMP = TRUE
1383 else if ( $CHEM == FALSE ) then
1384 set ZAP_OPENMP = FALSE
1385 endif
1386 # check compiler version, JM
1387 lslpp -i | grep xlf | grep ' xlfcmp ' | head -1
1388 set xlfvers=`lslpp -i | grep xlf | grep ' xlfcmp ' | head -1 | awk '{print $2}' | sed 's/\...*$//'`
1389 if ( ( $xlfvers > 9 ) && ( $NESTED == TRUE ) ) then
1390 # set ZAP_OPENMP = TRUE
1391 endif
1392 # end of compiler check, JM
1393 echo "Compiler version info: " >! version_info
1394 echo "FORTRAN: " `lslpp -l | grep xlfrte | head -1 | awk '{print $1 " " $2}'` >>! version_info
1395 echo " " >>! version_info
1396 echo "OS version info: " >>! version_info
1397 echo "AIX: " `lslpp -l | grep bos.mp | head -1 | awk '{print $1 " " $2}'` >>! version_info
1398 echo " " >>! version_info
1399 setenv MP_SHARED_MEMORY yes
1400 else if ( $ARCH[1] == Darwin ) then
1401 if ( ( `hostname` == stink ) && ( -d /stink/gill/Regression_Tests ) ) then
1402 set DEF_DIR = /stink/gill/Regression_Tests/wrf_regression
1403 mkdir $DEF_DIR
1404 else
1405 echo "We at least need a directory from which to do stuff"
1406 exit ( 2 )
1407 endif
1408 set TMPDIR = .
1409 set MAIL = /usr/bin/mailx
1410 if ( $LINUX_COMP == PGI ) then
1411 set COMPOPTS = ( 1 2 3 )
1412 set ZAP_OPENMP = FALSE
1413 else if ( $LINUX_COMP == G95 ) then
1414 set COMPOPTS = ( 13 0 14 )
1415 set ZAP_OPENMP = TRUE
1416 endif
1417 set COMPOPTS_NO_NEST = 0
1418 set COMPOPTS_NEST_STATIC = 1
1419 set COMPOPTS_NEST_PRESCRIBED = 2
1420 set Num_Procs = 4
1421 set OPENMP = 2
1422 cat >! `pwd`/machfile << EOF
1423 `hostname`
1424 `hostname`
1425 `hostname`
1426 `hostname`
1428 set Mach = `pwd`/machfile
1429 set SERIALRUNCOMMAND =
1430 set OMPRUNCOMMAND =
1431 echo "Compiler version info: " >! version_info
1432 if ( $LINUX_COMP == PGI ) then
1433 set MPIRUNCOMMAND = ( /usr/local/mpich2-1.0.6p1-pgi/bin/mpirun -np $Num_Procs )
1434 pgf90 -V | head -2 | tail -1 >>&! version_info
1435 else if ( $LINUX_COMP == G95 ) then
1436 set MPIRUNCOMMAND = ( /stink/gill/local/bin/mpirun -np $Num_Procs )
1437 g95 -v |& grep gcc >>&! version_info
1438 endif
1439 echo " " >>! version_info
1440 echo "OS version info: " >>! version_info
1441 uname -a >>&! version_info
1442 echo " " >>! version_info
1443 ps -A | grep mpd | grep -v grep >& /dev/null
1444 set ok = $status
1445 if ( $ok != 0 ) then
1446 echo starting an mpd process
1447 mpd &
1448 endif
1449 else if ( $ARCH[1] == OSF1 && $clrm == 1 ) then
1450 set DEF_DIR = /`hostname | cut -d. -f1`/$user
1451 set TMPDIR = /mmmtmp/$user
1452 set MAIL = /usr/bin/mailx
1453 if ( ( $NESTED == TRUE ) && ( $RSL_LITE != TRUE ) ) then
1454 set COMPOPTS = ( 2 4 6 )
1455 else if ( ( $NESTED != TRUE ) && ( $RSL_LITE != TRUE ) ) then
1456 set COMPOPTS = ( 1 3 6 )
1457 else if ( ( $NESTED == TRUE ) && ( $RSL_LITE == TRUE ) ) then
1458 set COMPOPTS = ( 2 4 5 )
1459 else if ( ( $NESTED != TRUE ) && ( $RSL_LITE == TRUE ) ) then
1460 set COMPOPTS = ( 1 3 5 )
1461 endif
1462 set Num_Procs = 4
1463 set OPENMP = 0
1464 set ZAP_OPENMP = TRUE
1465 cat >! $TMPDIR/machfile << EOF
1466 service03
1467 service04
1468 service05
1469 service06
1471 set Mach = $TMPDIR/machfile
1472 set MPIRUNCOMMAND = ( mpirun -np $Num_Procs -machinefile $Mach )
1473 echo "Compiler version info: " >! version_info
1474 f90 -version >>&! version_info
1475 echo " " >>! version_info
1476 echo "OS version info: " >>! version_info
1477 uname -a >>&! version_info
1478 echo " " >>! version_info
1479 else if ( ( $ARCH[1] == Linux ) && ( `hostname` == bay-mmm ) ) then
1480 set DEF_DIR = /data3/mp/${user}/`hostname`
1481 if ( ! -d $DEF_DIR ) mkdir $DEF_DIR
1482 set TMPDIR = .
1483 set MAIL = /bin/mail
1484 if ( $LINUX_COMP == PGI ) then
1485 if ( ( $NESTED == TRUE ) && ( $RSL_LITE != TRUE ) ) then
1486 set COMPOPTS = ( 2 4 5 )
1487 else if ( ( $NESTED != TRUE ) && ( $RSL_LITE != TRUE ) ) then
1488 set COMPOPTS = ( 1 3 5 )
1489 else if ( ( $NESTED == TRUE ) && ( $RSL_LITE == TRUE ) ) then
1490 set COMPOPTS = ( 2 4 6 )
1491 else if ( ( $NESTED != TRUE ) && ( $RSL_LITE == TRUE ) ) then
1492 set COMPOPTS = ( 1 3 6 )
1493 endif
1494 else if ( $LINUX_COMP == INTEL ) then
1495 if ( $NESTED == TRUE ) then
1496 set COMPOPTS = ( 8 10 11 )
1497 else if ( $NESTED != TRUE ) then
1498 set COMPOPTS = ( 7 9 11 )
1499 endif
1500 endif
1501 set Num_Procs = 2
1502 set OPENMP = $Num_Procs
1503 cat >! machfile << EOF
1504 `hostname`
1505 `hostname`
1506 `hostname`
1507 `hostname`
1509 set Mach = `pwd`/machfile
1510 if ( $CHEM == TRUE ) then
1511 set ZAP_OPENMP = TRUE
1512 else if ( $CHEM == FALSE ) then
1513 set ZAP_OPENMP = FALSE
1514 endif
1515 if ( $LINUX_COMP == INTEL ) then
1516 set ZAP_OPENMP = TRUE
1517 endif
1518 set MPIRUNCOMMAND = ( mpirun -np $Num_Procs -machinefile $Mach )
1519 echo "Compiler version info: " >! version_info
1520 if ( $LINUX_COMP == PGI ) then
1521 pgf90 -V >>&! version_info
1522 else if ( $LINUX_COMP == INTEL ) then
1523 ifort -v >>&! version_info
1524 endif
1525 echo " " >>! version_info
1526 echo "OS version info: " >>! version_info
1527 uname -a >>&! version_info
1528 echo " " >>! version_info
1529 else if ( ( $ARCH[1] == Linux ) && ( `hostname | cut -c 1-2` == ln ) ) then
1530 set DEF_DIR = /ptmp/${user}/wrf_regtest
1531 if ( ! -d $DEF_DIR ) mkdir $DEF_DIR
1532 set TMPDIR = .
1533 set MAIL = /bin/mail
1534 if ( $LINUX_COMP == PGI ) then
1535 if ( ( $NESTED == TRUE ) && ( $RSL_LITE != TRUE ) ) then
1536 set COMPOPTS = ( 4 2 3 )
1537 else if ( ( $NESTED != TRUE ) && ( $RSL_LITE != TRUE ) ) then
1538 set COMPOPTS = ( 1 2 3 )
1539 endif
1540 endif
1541 set Num_Procs = 4
1542 set OPENMP = 2
1543 cat >! machfile << EOF
1544 `hostname`
1545 `hostname`
1546 `hostname`
1547 `hostname`
1549 set Mach = `pwd`/machfile
1550 set ZAP_OPENMP = TRUE
1551 set MPIRUNCOMMAND = mpirun.lsf
1552 echo "Compiler version info: " >! version_info
1553 if ( $LINUX_COMP == PGI ) then
1554 pgf90 -V >>&! version_info
1555 else if ( $LINUX_COMP == INTEL ) then
1556 ifort -v >>&! version_info
1557 endif
1558 echo " " >>! version_info
1559 echo "OS version info: " >>! version_info
1560 uname -a >>&! version_info
1561 echo " " >>! version_info
1562 else if ( ( $ARCH[1] == Linux ) && ( `hostname` == loquat ) ) then
1563 set job_id = $$
1564 set DEF_DIR = /loquat2/$user/wrf_regression.${job_id}
1565 set TMPDIR = $DEF_DIR
1566 if ( -d $DEF_DIR ) then
1567 echo "${0}: ERROR:: Directory ${DEF_DIR} exists, please remove it"
1568 exit ( 1 )
1569 else
1570 mkdir -p $DEF_DIR
1571 echo "See directory ${DEF_DIR}/ for wrftest.output and other test results"
1572 endif
1573 set MAIL = /bin/mail
1574 if ( $LINUX_COMP == PGI ) then
1575 if ( ( $NESTED == TRUE ) && ( $RSL_LITE != TRUE ) ) then
1576 set COMPOPTS = ( 2 4 5 )
1577 else if ( ( $NESTED != TRUE ) && ( $RSL_LITE != TRUE ) ) then
1578 set COMPOPTS = ( 1 3 5 )
1579 else if ( ( $NESTED == TRUE ) && ( $RSL_LITE == TRUE ) ) then
1580 set COMPOPTS = ( 2 4 6 )
1581 else if ( ( $NESTED != TRUE ) && ( $RSL_LITE == TRUE ) ) then
1582 set COMPOPTS = ( 1 3 6 )
1583 endif
1584 else if ( $LINUX_COMP == INTEL ) then
1585 if ( $NESTED == TRUE ) then
1586 set COMPOPTS = ( 8 10 11 )
1587 else if ( $NESTED != TRUE ) then
1588 set COMPOPTS = ( 7 9 11 )
1589 endif
1590 endif
1591 set Num_Procs = 2
1592 set OPENMP = $Num_Procs
1593 cat >! machfile << EOF
1594 `hostname`
1595 `hostname`
1596 `hostname`
1597 `hostname`
1599 set Mach = `pwd`/machfile
1600 if ( $CHEM == TRUE ) then
1601 set ZAP_OPENMP = TRUE
1602 else if ( $CHEM == FALSE ) then
1603 set ZAP_OPENMP = FALSE
1604 endif
1605 if ( $LINUX_COMP == INTEL ) then
1606 set ZAP_OPENMP = TRUE
1607 endif
1608 set MPIRUNCOMMAND = ( mpirun -np $Num_Procs -machinefile $Mach )
1609 echo "Compiler version info: " >! version_info
1610 if ( $LINUX_COMP == PGI ) then
1611 pgf90 -V >>&! version_info
1612 else if ( $LINUX_COMP == INTEL ) then
1613 ifort -v >>&! version_info
1614 endif
1615 echo " " >>! version_info
1616 echo "OS version info: " >>! version_info
1617 uname -a >>&! version_info
1618 echo " " >>! version_info
1619 else if ( `hostname` == tempest ) then
1620 set DEF_DIR = /ptmp/${user}/wrf_regtest.${QSUB_REQID}
1621 if ( ! -d $DEF_DIR ) mkdir $DEF_DIR
1622 set TMPDIR = .
1623 set MAIL = /usr/sbin/Mail
1624 set COMPOPTS = ( 1 2 3 )
1625 set Num_Procs = 2
1626 set OPENMP = $Num_Procs
1627 set Mach = `pwd`/machfile
1628 set ZAP_OPENMP = TRUE
1629 set MPIRUNCOMMAND = ( mpirun -np $Num_Procs )
1630 echo "Compiler version info: " >! version_info
1631 f90 -version >>&! version_info
1632 echo " " >>! version_info
1633 echo "OS version info: " >>! version_info
1634 uname -a >>&! version_info
1635 echo " " >>! version_info
1636 else if ( ( $ARCH[1] == Linux ) && ( `hostname` == master ) ) then
1637 set DEF_DIR = /big6/gill/DO_NOT_REMOVE_DIR
1638 set TMPDIR = .
1639 set MAIL = /bin/mail
1640 if ( $LINUX_COMP == PGI ) then
1641 if ( $NESTED == TRUE ) then
1642 set COMPOPTS = ( 2 4 5 )
1643 else if ( ( $NESTED != TRUE ) && ( $RSL_LITE == TRUE ) ) then
1644 set COMPOPTS = ( 1 3 6 )
1645 else if ( ( $NESTED != TRUE ) && ( $RSL_LITE != TRUE ) ) then
1646 set COMPOPTS = ( 1 3 5 )
1647 endif
1648 else if ( $LINUX_COMP == INTEL ) then
1649 if ( $NESTED == TRUE ) then
1650 set COMPOPTS = ( 8 10 11 )
1651 else if ( $NESTED != TRUE ) then
1652 set COMPOPTS = ( 7 9 11 )
1653 endif
1654 endif
1655 set Num_Procs = 4
1656 set OPENMP = 2
1657 cat >! machfile << EOF
1658 node3
1659 node3
1660 node4
1661 node4
1663 set Mach = `pwd`/machfile
1664 if ( $CHEM == TRUE ) then
1665 set ZAP_OPENMP = TRUE
1666 else if ( $CHEM == FALSE ) then
1667 set ZAP_OPENMP = FALSE
1668 endif
1669 if ( $LINUX_COMP == INTEL ) then
1670 set ZAP_OPENMP = TRUE
1671 endif
1672 set MPIRUNCOMMAND = ( mpirun -v -np $Num_Procs -machinefile $Mach -nolocal )
1673 set MPIRUNCOMMANDPOST = "< /dev/null"
1674 echo "Compiler version info: " >! version_info
1675 if ( $LINUX_COMP == PGI ) then
1676 pgf90 -V >>&! version_info
1677 else if ( $LINUX_COMP == INTEL ) then
1678 ifort -v >>&! version_info
1679 endif
1680 echo " " >>! version_info
1681 echo "OS version info: " >>! version_info
1682 uname -a >>&! version_info
1683 echo " " >>! version_info
1684 else
1685 echo "Unrecognized architecture for regression test" >! error_message
1686 echo `uname` >> error_message
1687 echo `hostname` >> error_message
1688 $MAIL -s "Unknown architecture $ARCH[1] " $FAIL_MAIL < error_message
1689 exit ( 1 )
1690 endif
1692 #####################################################################
1693 #DAVE###################################################
1694 echo did the arch specific stuff
1695 banner 3
1696 #set ans = "$<"
1697 #DAVE###################################################
1699 if ( $FDDA == TRUE ) then
1700 if ( ( $PHYSOPTS_FDDA == GRID ) && ( $ZAP_OPENMP == FALSE ) ) then
1701 set ZAP_OPENMP = FALSE
1702 else if ( $PHYSOPTS_FDDA == BOTH ) then
1703 set ZAP_OPENMP = TRUE
1704 endif
1705 endif
1707 # First of all, in which particular directory do we start.
1709 cd $DEF_DIR
1711 # We want to keep the old regression stuff around
1713 if ( -d regression_test ) then
1714 if ( -d regression_test.old ) then
1715 /bin/rm -fr regression_test.old
1716 endif
1717 /bin/mv regression_test regression_test.old
1718 endif
1720 # Go to the regression test directory
1722 mkdir regression_test
1723 set ok = $status
1724 if ( $ok != 0 ) then
1725 echo "Gee, I cannot make a directory in $DEF_DIR" >! error_message
1726 echo `pwd` >> error_message
1727 echo `\ls -ls` >> error_message
1728 $MAIL -s "$DEF_DIR not writable $ARCH[1] " $FAIL_MAIL < error_message
1729 exit ( 1 )
1730 else
1731 pushd regression_test
1732 endif
1734 if ( $acquire_from == "cvs" ) then
1736 # Checkout the most recent version of WRF from the NCAR cvs repository,
1737 # and pick up the required input data from the anonymous ftp site.
1739 cvs checkout -D $thedate WRFV3
1740 find ./WRFV3 -exec touch \{\} \;
1741 ftp -n ftp.ucar.edu < ftp_script_data
1744 else if ( $acquire_from == "filearg" ) then
1746 # A tar file of the WRF source was provided, so that is used, along with
1747 # the required input data files from the ftp site.
1749 tar xvf $thefile
1750 cd WRFV3
1751 clean -a
1752 cd ..
1753 ftp -n ftp.ucar.edu < ftp_script_data
1755 else if ( $acquire_from == "environment" ) then
1757 # A tar file of WRF is assumed to be available.
1759 tar xvf $thefile
1761 endif
1763 # And we can stick the input data where we want, the WRFV3 directory has been created.
1765 ( cd WRFV3/test/em_real ; ln -sf $thedataem/* . )
1766 #( cd WRFV3/test/nmm_real ; ln -s $thedatanmm/wrf_real* . ; cp $thedatanmm/namelist.input.regtest . )
1767 ( cd WRFV3/test/nmm_real ; ln -s $thedatanmm/wrf_real* . ; ln -s $thedatanmm/wrf_nest* . ; ln -s $thedatanmm/geo_* .; \
1768 cp $thedatanmm/namelist.nest.regtest . ; ln -s $thedatanmm/met_nmm* . ; \
1769 sed '/dyn_opt/d' $thedatanmm/namelist.input.regtest >! ./namelist.input.regtest )
1771 ##LPC( cd WRFV3/test/nmm_real ; ln -s $thedatanmm/wrf_real* . ; \
1772 ##LPC sed '/dyn_opt/d' $thedatanmm/namelist.input.regtest >! ./namelist.input.regtest )
1773 #DAVE###################################################
1774 ( cd WRFV3/test/em_real ; ls -ls )
1775 ( cd WRFV3/test/nmm_real ; ls -ls )
1776 banner 4
1777 #set ans = "$<"
1778 #DAVE###################################################
1780 # John-specific stuff for maple is the else; part of the "using service machines".
1782 if ( ! $clrm ) then
1783 pushd WRFV3
1784 else
1785 if ( ! -d $TMPDIR ) then
1786 echo something wrong 1
1787 endif
1788 if ( ! -d $TMPDIR/RUN ) then
1789 mkdir $TMPDIR/RUN
1790 /bin/rm -fr $TMPDIR/RUN/*
1791 endif
1792 if ( -d $TMPDIR/RUN ) then
1793 tar cf - ./WRFV3/test ./WRFV3/main | ( cd $TMPDIR/RUN ; tar xvf - )
1794 pushd WRFV3
1795 else
1796 echo something wrong 2
1797 exit
1798 endif
1799 endif
1801 # Here we initialize our output message.
1803 if ( -e ${DEF_DIR}/wrftest.output ) rm ${DEF_DIR}/wrftest.output
1804 echo "Architecture $ARCH[1] machine: `hostname`" >>! ${DEF_DIR}/wrftest.output
1805 echo "WRFV3 source from: $acquire_from " >>! ${DEF_DIR}/wrftest.output
1806 echo "Number of OpenMP processes to use: $OPENMP" >>! ${DEF_DIR}/wrftest.output
1807 echo "Number of MPI processes to use: $Num_Procs" >>! ${DEF_DIR}/wrftest.output
1808 if ( $ARCH[1] == Darwin ) then
1809 set name = `finger $user | grep "Name:" | awk '{print $4 " " $5}'`
1810 else
1811 set name = ( `grep ^${user}: /etc/passwd | cut -d: -f5` )
1812 endif
1813 echo "Test conducted by $name" >>! ${DEF_DIR}/wrftest.output
1814 echo " " >>! ${DEF_DIR}/wrftest.output
1815 echo "Test run from directory ${CUR_DIR}" >>! ${DEF_DIR}/wrftest.output
1816 echo " " >>! ${DEF_DIR}/wrftest.output
1817 if ( $?LOADL_JOB_NAME ) then
1818 echo "Loadlever job name = ${LOADL_JOB_NAME}" >>! ${DEF_DIR}/wrftest.output
1819 echo " " >>! ${DEF_DIR}/wrftest.output
1820 endif
1821 echo "Real data case for EM is from $dataset " >>! ${DEF_DIR}/wrftest.output
1822 echo " " >>! ${DEF_DIR}/wrftest.output
1823 echo "The em real and ideal forecasts will be nested: $NESTED " >>! ${DEF_DIR}/wrftest.output
1824 echo " " >>! ${DEF_DIR}/wrftest.output
1825 if ( $REG_TYPE == BIT4BIT ) then
1826 echo "This is a bit-wise (traditional) regression test. " >>! ${DEF_DIR}/wrftest.output
1827 echo " " >>! ${DEF_DIR}/wrftest.output
1828 else if ( $REG_TYPE == OPTIMIZED ) then
1829 echo "This is a fully optimized regression test. " >>! ${DEF_DIR}/wrftest.output
1830 echo "No inter-comparisons are made. " >>! ${DEF_DIR}/wrftest.output
1831 echo " " >>! ${DEF_DIR}/wrftest.output
1832 endif
1833 if ( $REAL8 == TRUE ) then
1834 echo "Floating point precision is 8-bytes" >>! ${DEF_DIR}/wrftest.output
1835 echo " " >>! ${DEF_DIR}/wrftest.output
1836 endif
1837 if ( ( $CHEM == TRUE ) && ( $KPP != TRUE ) ) then
1838 echo "WRF_CHEM tests run for em_real core only" >>! ${DEF_DIR}/wrftest.output
1839 echo " " >>! ${DEF_DIR}/wrftest.output
1840 else if ( ( $CHEM == TRUE ) && ( $KPP == TRUE ) ) then
1841 echo "WRF_CHEM KPP tests run for em_real core only" >>! ${DEF_DIR}/wrftest.output
1842 echo " " >>! ${DEF_DIR}/wrftest.output
1843 endif
1844 if ( $ADAPTIVE == TRUE ) then
1845 echo "Adaptive time step for em_real core only" >>! ${DEF_DIR}/wrftest.output
1846 echo " " >>! ${DEF_DIR}/wrftest.output
1847 endif
1848 if ( $GLOBAL == TRUE ) then
1849 echo "Global tests run for em_real core only" >>! ${DEF_DIR}/wrftest.output
1850 echo " " >>! ${DEF_DIR}/wrftest.output
1851 endif
1852 if ( $ESMF_LIB == TRUE ) then
1853 echo "A separately installed version of the latest ESMF library" >>! ${DEF_DIR}/wrftest.output
1854 echo "(NOT the ESMF library included in the WRF tarfile) will" >>! ${DEF_DIR}/wrftest.output
1855 echo "be used for MPI tests" >>! ${DEF_DIR}/wrftest.output
1856 echo " " >>! ${DEF_DIR}/wrftest.output
1857 endif
1858 if ( $QUILT == TRUE ) then
1859 echo "One WRF output quilt server will be used for some tests" >>! ${DEF_DIR}/wrftest.output
1860 echo " " >>! ${DEF_DIR}/wrftest.output
1861 endif
1862 if ( $FDDA == TRUE ) then
1863 if ( $PHYSOPTS_FDDA == GRID ) then
1864 echo "Running FDDA tests (grid nudging only)" >>! ${DEF_DIR}/wrftest.output
1865 echo " " >>! ${DEF_DIR}/wrftest.output
1866 else if ( $PHYSOPTS_FDDA == BOTH ) then
1867 echo "Running FDDA tests (grid=1, obs=2, grid+obs=3)" >>! ${DEF_DIR}/wrftest.output
1868 echo " " >>! ${DEF_DIR}/wrftest.output
1869 endif
1870 endif
1871 if ( $GENERATE_BASELINE != FALSE ) then
1872 echo "WRF output will be archived in baseline directory ${GENERATE_BASELINE} for some tests" >>! \
1873 ${DEF_DIR}/wrftest.output
1874 echo " " >>! ${DEF_DIR}/wrftest.output
1875 endif
1876 if ( $COMPARE_BASELINE != FALSE ) then
1877 echo "WRF output will be compared with files in baseline directory ${COMPARE_BASELINE} for some tests" >>! \
1878 ${DEF_DIR}/wrftest.output
1879 echo " " >>! ${DEF_DIR}/wrftest.output
1880 endif
1881 echo "The selected I/O option is $IO_FORM ($IO_FORM_NAME[$IO_FORM])" >>! ${DEF_DIR}/wrftest.output
1882 if ( $IO_FORM_WHICH[$IO_FORM] == IO ) then
1883 echo "This option is for both input and history files" >>! ${DEF_DIR}/wrftest.output
1884 echo " " >>! ${DEF_DIR}/wrftest.output
1885 else if ( $IO_FORM_WHICH[$IO_FORM] == I ) then
1886 echo "This option is for input files only" >>! ${DEF_DIR}/wrftest.output
1887 echo " " >>! ${DEF_DIR}/wrftest.output
1888 else if ( $IO_FORM_WHICH[$IO_FORM] == O ) then
1889 echo "This option is for history files only" >>! ${DEF_DIR}/wrftest.output
1890 echo " " >>! ${DEF_DIR}/wrftest.output
1891 endif
1893 cat ${CUR_DIR}/version_info >>! ${DEF_DIR}/wrftest.output
1895 # There are three WRF em executables to be considered that can run in threaded and
1896 # distributed memory. The 2d hills and 2d squall lines cannot be parallelized with
1897 # MPI, and are therefore not considered in this shell. The nmm is only run with
1898 # distributed memory (1 vs 4 procs).
1900 set first_time_in = TRUE
1901 foreach core ( $CORES )
1902 #DAVE###################################################
1903 echo doing core $core
1904 banner 5
1905 #set ans = "$<"
1906 #DAVE###################################################
1908 # Some sleight of hand is required for the chemistry tests because we need to
1909 # build it twice. But normally, we only build with different real vs ideal, or em vs nmm.
1910 # What to do, what to do? Well, we ask for em_real TWICE. The first time we build without chemistry
1911 # activated, the second time with it activated. The first time, we do a single
1912 # test, the second time through, we do the other 5 tests.
1914 if ( ( $CHEM == TRUE ) && ( ${#CORES} == 2 ) && ( $first_time_in == TRUE ) ) then
1915 setenv WRF_CHEM 0
1916 set PHYSOPTS = ( 1 )
1917 set first_time_in = FALSE
1918 else if ( ( $CHEM == TRUE ) && ( $KPP != TRUE ) && ( ${#CORES} == 2 ) && ( $first_time_in != TRUE ) ) then
1919 setenv WRF_CHEM 1
1920 set PHYSOPTS = ( 2 3 4 5 6 )
1921 else if ( ( $CHEM == TRUE ) && ( $KPP == TRUE ) && ( ${#CORES} == 2 ) && ( $first_time_in != TRUE ) ) then
1922 setenv WRF_CHEM 1
1923 set PHYSOPTS = ( 2 3 )
1924 endif
1926 # Cores to test.
1928 set ZAP_SERIAL_FOR_THIS_CORE = FALSE
1929 set ZAP_OPENMP_FOR_THIS_CORE = FALSE
1930 if ( `echo $core | cut -c 1-2` == em ) then
1931 setenv WRF_EM_CORE 1
1932 setenv WRF_NMM_CORE 0
1933 setenv WRF_COAMPS_CORE 0
1934 setenv WRF_EXP_CORE 0
1935 set ZAP_SERIAL_FOR_THIS_CORE = FALSE
1936 set ZAP_OPENMP_FOR_THIS_CORE = FALSE
1937 else if ( `echo $core | cut -c 1-3` == nmm ) then
1938 setenv WRF_EM_CORE 0
1939 setenv WRF_NMM_CORE 1
1940 setenv WRF_NMM_NEST 1
1941 setenv WRF_COAMPS_CORE 0
1942 setenv WRF_EXP_CORE 0
1943 set ZAP_SERIAL_FOR_THIS_CORE = TRUE
1944 set ZAP_OPENMP_FOR_THIS_CORE = TRUE
1945 endif
1947 # Here we are looping over all of the various compilation configurations,
1948 # such as serial only, OpenMP only, MPI only, etc. Each architecture
1949 # has its own list of these options. We build each of the executables for
1950 # this particular ${core}.
1952 foreach compopt ( $COMPOPTS )
1953 #DAVE###################################################
1954 echo doing compile option $compopt
1955 banner 6
1956 #set ans = "$<"
1957 #DAVE###################################################
1959 # We sometimes are interested in bypassing the OpenMP option.
1961 if ( $compopt == $COMPOPTS[2] ) then
1962 if ( $ZAP_OPENMP == TRUE || $ZAP_OPENMP_FOR_THIS_CORE == TRUE ) then
1963 goto GOT_THIS_EXEC
1964 endif
1965 endif
1967 # NMM only runs parallel
1968 if ( $compopt == $COMPOPTS[1] ) then
1969 if ( $ZAP_SERIAL == TRUE || $ZAP_SERIAL_FOR_THIS_CORE == TRUE ) then
1970 goto GOT_THIS_EXEC
1971 endif
1972 endif
1974 if ( `uname` == AIX ) goto BUILD_REGARDLESS
1976 # Did we already build this one?
1978 if ( $core == em_real ) then
1979 if ( ( $compopt == $COMPOPTS[1] ) && \
1980 ( -e main/wrf_${core}.exe.$compopt ) && \
1981 ( -e main/real_${core}.exe.1 ) && \
1982 ( -e ${DEF_DIR}/regression_test/WRFV3/external/$IO_FORM_NAME[$IO_FORM]/diffwrf ) ) then
1983 goto GOT_THIS_EXEC
1984 else if ( ( $compopt != $COMPOPTS[1] ) && \
1985 ( -e main/wrf_${core}.exe.$compopt ) && \
1986 ( -e ${DEF_DIR}/regression_test/WRFV3/external/$IO_FORM_NAME[$IO_FORM]/diffwrf ) ) then
1987 goto GOT_THIS_EXEC
1988 endif
1989 else
1990 if ( ( $compopt == $COMPOPTS[1] ) && \
1991 ( -e main/wrf_${core}.exe.$compopt ) && \
1992 ( -e main/ideal_${core}.exe.1 ) && \
1993 ( -e ${DEF_DIR}/regression_test/WRFV3/external/$IO_FORM_NAME[$IO_FORM]/diffwrf ) ) then
1994 goto GOT_THIS_EXEC
1995 else if ( ( $compopt != $COMPOPTS[1] ) && \
1996 ( -e main/wrf_${core}.exe.$compopt ) && \
1997 ( -e ${DEF_DIR}/regression_test/WRFV3/external/$IO_FORM_NAME[$IO_FORM]/diffwrf ) ) then
1998 goto GOT_THIS_EXEC
1999 endif
2000 endif
2002 BUILD_REGARDLESS:
2004 # The WRF configuration file works with a single integer
2005 # input, which is the compiler option. By convention, option $COMPOPTS[1] is
2006 # serial, $COMPOPTS[2] is OMP, and $COMPOPTS[3] is MPI.
2008 # Print info about use of separately installed ESMF library.
2009 set esmf_lib_str = " - - - - - - - - - - - - - "
2010 if ( $ESMF_LIB == TRUE ) then
2011 # only test ESMF with MPI
2012 if ( $compopt == $COMPOPTS[3] ) then
2013 echo "A separately installed version of the latest ESMF library" >>! ${DEF_DIR}/wrftest.output
2014 echo "(NOT the ESMF library included in the WRF tarfile) is" >>! ${DEF_DIR}/wrftest.output
2015 echo "being used for this test of $core parallel $compopt..." >>! ${DEF_DIR}/wrftest.output
2016 set esmf_lib_str = "using separate ESMF library"
2017 echo "Setting ESMFLIB = ${ESMFLIBSAVE}" >>! ${DEF_DIR}/wrftest.output
2018 echo "Setting ESMFINC = ${ESMFINCSAVE}" >>! ${DEF_DIR}/wrftest.output
2019 setenv ESMFLIB $ESMFLIBSAVE
2020 setenv ESMFINC $ESMFINCSAVE
2021 else
2022 unsetenv ESMFLIB
2023 unsetenv ESMFINC
2024 endif
2025 endif
2027 #DAVE###################################################
2028 echo start build mechanism
2029 banner 7
2030 #set ans = "$<"
2031 #DAVE###################################################
2032 ./clean -a
2034 # Edit build command for either bit-wise comparison or full optimization.
2036 if ( $REG_TYPE == BIT4BIT ) then
2037 set DEBUG_FLAG = -d
2038 else
2039 set DEBUG_FLAG =
2040 endif
2042 # Edit build command. If this is a nested run, then either static nest
2043 # (idealized) or prescribed move (em_real). If not nested, then shut off
2044 # the nesting build option.
2046 if ( $NESTED == TRUE ) then
2047 if ( $core == em_real ) then
2048 set compopts_nest = $COMPOPTS_NEST_PRESCRIBED
2049 else
2050 set compopts_nest = $COMPOPTS_NEST_STATIC
2051 endif
2052 else
2053 set compopts_nest = $COMPOPTS_NO_NEST
2054 endif
2056 ./configure $DEBUG_FLAG << EOF
2057 $compopt
2058 $compopts_nest
2060 cp configure.wrf configure.wrf.core=${core}_build=${compopt}
2062 # The configure.wrf file needs to be adjusted as to whether we are requesting real*4 or real*8
2063 # as the default floating precision.
2065 if ( $REAL8 == TRUE ) then
2066 sed -e '/^RWORDSIZE/s/\$(NATIVE_RWORDSIZE)/8/' configure.wrf > ! foo ; /bin/mv foo configure.wrf
2067 endif
2069 # Fix the OpenMP default for IBM regression testing - noopt required for bit-wise comparison.
2071 if ( ( $compopt == $COMPOPTS[2] ) && ( `uname` == AIX ) ) then
2072 sed -e '/^OMP/s/-qsmp=noauto/-qsmp=noauto:noopt/' configure.wrf > ! foo ; /bin/mv foo configure.wrf
2073 endif
2075 # Save the configure file.
2077 cp configure.wrf configure.wrf.core=${core}_build=${compopt}
2079 #DAVE###################################################
2080 echo configure built with optim mods removed, ready to compile
2081 banner 8
2082 #set ans = "$<"
2083 #DAVE###################################################
2085 # The WRF_SRC_ROOT_DIR hack is only used by the OSF1 build.
2086 # It works around the annoying fact that in OSF1 $(PWD) does
2087 # not change during execution of regtest.csh, despite the "cd"
2088 # and "pushd" commands.
2089 setenv WRF_SRC_ROOT_DIR "${DEF_DIR}/regression_test/WRFV3"
2090 # Build this executable
2092 ./compile $core >&! compile_${core}_build=${compopt}.log
2093 #DAVE###################################################
2094 echo compile done
2095 banner 9
2096 #set ans = "$<"
2097 #DAVE###################################################
2099 # Did the compile work? Check the expected executable names and locations.
2101 set ok = $status
2102 if ( ! -x main/wrf.exe ) set ok = 1
2104 if ( ( $core == em_real ) && ( $compopt == $COMPOPTS[1] ) ) then
2105 if ( ! -e main/real.exe ) set ok = 1
2106 else if ( ( $core == nmm_real ) && ( $compopt == $COMPOPTS[3] ) ) then
2107 if ( ! -e main/real_nmm.exe ) set ok = 1
2108 else if ( $compopt == $COMPOPTS[1] ) then
2109 if ( ! -e main/ideal.exe ) set ok = 1
2110 endif
2112 if ( ! -x external/io_netcdf/diffwrf ) set ok = 1
2113 # if ( ! -x external/io_int/diffwrf ) set ok = 1
2115 if ( $ok != 0 ) then
2116 echo "SUMMARY compilation for $core parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
2117 $MAIL -s "REGRESSION FAILURE $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
2118 exit ( 3 )
2119 else
2120 echo "SUMMARY compilation for $core parallel $compopt $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
2121 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2122 mv main/wrf.exe main/wrf_${core}.exe.$compopt
2123 if ( ( $core == em_real ) && ( $compopt == $COMPOPTS[1] ) ) then
2124 mv main/real.exe main/real_${core}.exe.1
2125 else if ( ( $core == nmm_real ) && ( $compopt == $COMPOPTS[3] ) ) then
2126 mv main/real_nmm.exe main/real_${core}.exe.$COMPOPTS[3]
2127 else if ( $compopt == $COMPOPTS[1] ) then
2128 mv main/ideal.exe main/ideal_${core}.exe.1
2129 endif
2130 #DAVE###################################################
2131 echo exec exists
2132 ls -ls main/*.exe*
2133 banner 10
2134 #set ans = "$<"
2135 #DAVE###################################################
2136 endif
2138 GOT_THIS_EXEC:
2140 if ( $clrm ) then
2141 cp main/*exe* $TMPDIR/RUN/WRFV3/main
2142 endif
2146 if ( $clrm ) then
2147 pushd $TMPDIR/RUN/WRFV3
2148 endif
2150 # We have all of the executables built, now we run'em. This is a loop
2151 # over all of the various physics options for this particular
2152 # ${core}. Inside the physics loop, we loop over the parallel options.
2153 # This allows us to use the same WRF input files for each of the parallel
2154 # choices for a single physics loop index.
2156 foreach phys_option ( $PHYSOPTS )
2157 #DAVE###################################################
2158 echo which phys option $phys_option
2159 banner 11
2160 #set ans = "$<"
2161 #DAVE###################################################
2163 # For each of the executables, we need to run several physics
2164 # options.
2166 if ( $core == em_real ) then
2168 if ( $CHEM != TRUE ) then
2169 set filetag=$filetag_real
2170 else if ( $CHEM == TRUE ) then
2171 if ( $phys_option <= 3 ) then
2172 set filetag=$filetag_real[1]
2173 else
2174 set filetag=$filetag_real[2]
2175 endif
2176 endif
2178 foreach compopt ( $COMPOPTS )
2179 #DAVE###################################################
2180 echo real if filetag is $filetag
2181 echo compopt = $compopt
2182 banner 12
2183 #set ans = "$<"
2184 #DAVE###################################################
2186 # We sometimes are interested in bypassing the OpenMP option.
2188 if ( $compopt == $COMPOPTS[2] ) then
2189 if ( $ZAP_OPENMP == TRUE || $ZAP_OPENMP_FOR_THIS_CORE == TRUE ) then
2190 goto BYPASS_COMP_LOOP_REAL
2191 endif
2192 endif
2194 if ( $compopt == $COMPOPTS[1] ) then
2195 if ( $ZAP_SERIAL == TRUE || $ZAP_SERIAL_FOR_THIS_CORE == TRUE ) then
2196 goto BYPASS_COMP_LOOP_REAL
2197 endif
2198 endif
2200 pushd test/$core
2203 # Create the correct namelist.input file for real data cases.
2206 if ( $CHEM != TRUE ) then
2207 cp ${CUR_DIR}/phys_real_${phys_option} phys_opt
2208 if ( $NESTED != TRUE ) then
2209 cp ${CUR_DIR}/dyn_real_${phys_option} dyn_opt
2210 else
2211 cp ${CUR_DIR}/dyn_real_SAFE dyn_opt
2212 endif
2213 cp ${CUR_DIR}/time_real_${phys_option} time_opt
2214 cp ${CUR_DIR}/dom_real dom_real
2215 cp ${CUR_DIR}/nest_real_${phys_option} nest_input_opt
2216 cp ${CUR_DIR}/damp_real_${phys_option} damp_real
2217 if ( -e fdda_opt ) rm fdda_opt
2218 cat " grid_fdda=0" > fdda_opt
2219 if ( -e fdda_time ) rm fdda_time
2221 if ( $FDDA == TRUE ) then
2222 cp ${CUR_DIR}/fdda_real_${phys_option} fdda_opt
2223 cp ${CUR_DIR}/fdda_real_time_${phys_option} fdda_time
2224 endif
2226 set time_step = `awk ' /^ time_step /{ print $3 } ' namelist.input.$dataset | cut -d, -f1`
2228 # Wanna do more/less time steps on the real cases? Easy. Those last two numbers
2229 # in the eqns are all you need. Their product must be 60. So, instead of 3 and 20,
2230 # (3 coarse grid timesteps), you could use 20 and 3 (20 coarse grid time steps).
2232 if ( $NESTED == TRUE ) then
2233 @ run_seconds = $time_step * 3
2234 @ history_interval = $time_step / 20
2235 else if ( $NESTED != TRUE ) then
2236 @ run_seconds = $time_step * 10
2237 @ history_interval = $time_step / 6
2238 endif
2239 rm ed_in namelist.input.temp
2240 cat >! ed_in << EOF
2241 g/run_seconds/s/[0-9]/$run_seconds
2242 g/history_interval/s/[0-9][0-9][0-9]/$history_interval
2243 w namelist.input.temp
2246 ed namelist.input.$dataset < ed_in
2248 cp ${CUR_DIR}/io_format io_format
2249 sed -e '/^ mp_physics/,/ensdim/d' -e '/^ &physics/r ./phys_opt' \
2250 -e '/^ moist_adv_opt/,/scalar_adv_opt/d' -e '/^ non_hydrostatic/r ./dyn_opt' \
2251 -e '/^ auxinput1_inname/d' -e '/^ debug_level/r ./time_opt' \
2252 -e '/^ input_from_file/d' -e '/^ interval_seconds/r ./nest_input_opt' \
2253 -e '/^ time_step /,/^ smooth_option/d' -e '/^ &domains/r ./dom_real' \
2254 -e '/^ damp_opt /,/^ dampcoef/d' -e '/^ base_temp/r ./damp_real' \
2255 -e '/^ io_form_history /,/^ io_form_boundary/d' -e '/^ restart_interval/r ./io_format' \
2256 -e 's/ frames_per_outfile *= [0-9][0-9]*/ frames_per_outfile = 200/g' \
2257 -e 's/ run_days *= [0-9][0-9]*/ run_days = 0/g' \
2258 -e 's/ run_hours *= [0-9][0-9]*/ run_hours = 0/g' \
2259 -e 's/ run_minutes *= [0-9][0-9]*/ run_minutes = 0/g' \
2260 -e '/^ &fdda/r fdda_opt' \
2261 -e '/^ debug_level/r fdda_time' \
2262 -e '/dyn_opt/d' \
2263 namelist.input.temp >! namelist.input
2265 # The chem run has its own namelist, due to special input files (io_form not tested for chem)
2267 else if ( $CHEM == TRUE ) then
2268 if ( ( $KPP == TRUE ) && ( $phys_option >= 3 ) ) then
2269 sed -e '/dyn_opt/d' \
2270 -e 's/^ chem_opt *= [0-9]/ chem_opt = '${CHEM_OPT}'/' \
2271 namelist.input.chem_test_${phys_option} >! namelist.input
2272 else
2273 sed -e '/dyn_opt/d' \
2274 namelist.input.chem_test_${phys_option} >! namelist.input
2275 endif
2277 if ( -e met_em.d01.${filetag} ) then
2278 \rm met_em.d01.*
2279 endif
2280 if ( ${phys_option} <= 3 ) then
2281 ln -s 00z/met_em* .
2282 else
2283 ln -s 12z/met_em* .
2284 endif
2286 endif
2288 # WRF output quilt servers are only tested for MPI configuration.
2289 # Currently, only one WRF output quilt server is used.
2291 if ( $QUILT == TRUE ) then
2292 if ( $compopt == $COMPOPTS[3] ) then
2293 # For now, test only one group of one output quilt servers.
2294 sed -e 's/ nio_tasks_per_group *= *[0-9][0-9]*/ nio_tasks_per_group = 1/g' \
2295 -e 's/ nio_groups *= *[0-9][0-9]*/ nio_groups = 1/g' \
2296 namelist.input >! namelist.input.temp
2297 mv -f namelist.input.temp namelist.input
2298 echo "Building namelist.input.$core.${phys_option}.$compopt with one I/O quilt server enabled."
2299 echo "NOTE one I/O quilt server enabled for $core physics $phys_option parallel $compopt..." >>! ${DEF_DIR}/wrftest.output
2300 endif
2301 endif
2303 /bin/cp namelist.input $TMPDIR/namelist.input.$core.${phys_option}.$compopt
2304 #DAVE###################################################
2305 echo built namelist $TMPDIR/namelist.input.$core.${phys_option}.$compopt
2306 cat $TMPDIR/namelist.input.$core.${phys_option}.$compopt
2307 echo need history interval to be 30
2308 banner 13
2309 #set ans = "$<"
2310 #DAVE###################################################
2311 #DAVE###################################################
2312 echo skipped link of data files, we push them elsewhere
2313 ls -ls met_em*
2314 banner 14
2315 #set ans = "$<"
2316 #DAVE###################################################
2318 # If this is the serial code, generate the IC and BC. The real.exe program is not
2319 # parallelized, so the data is generated and saved for the rest of the parallel tests.
2320 # This data is necessarily updated for each of the physics tests.
2322 if ( $compopt == $COMPOPTS[1] ) then
2324 # Zap any old input data laying around.
2326 rm wrfinput_d01 >& /dev/null
2327 rm wrfbdy_d01 >& /dev/null
2329 if ( $NESTED == TRUE ) then
2330 setenv OMP_NUM_THREADS 1
2331 if ( `uname` == AIX ) then
2332 setenv XLSMPOPTS "parthds=1"
2333 endif
2334 $SERIALRUNCOMMAND ../../main/real_${core}.exe.1 >! print.out.real_${core}_Phys=${phys_option}_Parallel=${compopt}
2335 else if ( $NESTED != TRUE ) then
2336 ../../main/real_${core}.exe.1 >! print.out.real_${core}_Phys=${phys_option}_Parallel=${compopt}
2337 endif
2338 #DAVE###################################################
2339 echo finished real
2340 banner 15
2341 #set ans = "$<"
2342 #DAVE###################################################
2344 grep "SUCCESS COMPLETE" print.out.real_${core}_Phys=${phys_option}_Parallel=${compopt} >& /dev/null
2345 set success = $status
2347 # Did making the IC BC files work?
2349 if ( $GLOBAL == FALSE ) then
2350 if ( ( -e wrfinput_d01 ) && ( -e wrfbdy_d01 ) && ( $success == 0 ) ) then
2351 echo "SUMMARY generate IC/BC for $core physics $phys_option parallel $compopt $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
2352 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2353 else
2354 echo "SUMMARY generate IC/BC for $core physics $phys_option parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
2355 $MAIL -s "WRF FAIL making IC/BC $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
2356 if ( $KEEP_ON_RUNNING == FALSE ) exit ( 4 )
2357 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2358 endif
2359 else if ( $GLOBAL == TRUE ) then
2360 if ( ( -e wrfinput_d01 ) && ( $success == 0 ) ) then
2361 echo "SUMMARY generate IC for $core physics $phys_option parallel $compopt $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
2362 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2363 else
2364 echo "SUMMARY generate IC for $core physics $phys_option parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
2365 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2366 $MAIL -s "WRF FAIL making IC $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
2367 if ( $KEEP_ON_RUNNING == FALSE ) exit ( 41 )
2368 endif
2369 endif
2370 #DAVE###################################################
2371 echo IC BC must be OK
2372 ls -ls wrfi* wrfb*
2373 if ( $IO_FORM_NAME[$IO_FORM] == io_netcdf ) then
2374 ncdump -v Times wrfb* | tail -20
2375 endif
2376 banner 16
2377 #set ans = "$<"
2378 #DAVE###################################################
2379 endif
2381 # Run the forecast for this core, physics package and parallel option
2383 rm $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$compopt >& /dev/null
2385 # The chem run has its own set of namelists, due to special input files.
2387 if ( $CHEM == TRUE ) then
2389 # WRF output quilt servers are only tested for MPI configuration.
2390 # Currently, only one WRF output quilt server is used.
2392 if ( $QUILT == TRUE ) then
2393 if ( $compopt == $COMPOPTS[3] ) then
2394 # For now, test only one group of one output quilt servers.
2395 sed -e 's/ nio_tasks_per_group *= *[0-9][0-9]*/ nio_tasks_per_group = 1/g' \
2396 -e 's/ nio_groups *= *[0-9][0-9]*/ nio_groups = 1/g' \
2397 namelist.input >! namelist.input.temp
2398 mv -f namelist.input.temp namelist.input
2399 echo "Building namelist.input.$core.${phys_option}.$compopt with one I/O quilt server enabled."
2400 echo "NOTE one I/O quilt server enabled for $core physics $phys_option parallel $compopt..." >>! ${DEF_DIR}/wrftest.output
2401 endif
2402 endif
2403 endif
2405 if ( $compopt == $COMPOPTS[1] ) then
2406 setenv OMP_NUM_THREADS 1
2407 if ( `uname` == AIX ) then
2408 setenv XLSMPOPTS "parthds=1"
2409 endif
2410 if ( $NESTED == TRUE ) then
2411 $SERIALRUNCOMMAND ../../main/wrf_${core}.exe.$compopt >! print.out.wrf_${core}_Phys=${phys_option}_Parallel=${compopt}
2412 else if ( $NESTED != TRUE ) then
2413 ../../main/wrf_${core}.exe.$compopt >! print.out.wrf_${core}_Phys=${phys_option}_Parallel=${compopt}
2414 endif
2415 else if ( $compopt == $COMPOPTS[2] ) then
2416 setenv OMP_NUM_THREADS $OPENMP
2417 if ( `uname` == AIX ) then
2418 setenv XLSMPOPTS "parthds=${OPENMP}"
2419 endif
2420 if ( $NESTED == TRUE ) then
2421 $OMPRUNCOMMAND ../../main/wrf_${core}.exe.$compopt >! print.out.wrf_${core}_Phys=${phys_option}_Parallel=${compopt}
2422 else if ( $NESTED != TRUE ) then
2423 ../../main/wrf_${core}.exe.$compopt >! print.out.wrf_${core}_Phys=${phys_option}_Parallel=${compopt}
2424 endif
2425 else if ( $compopt == $COMPOPTS[3] ) then
2426 setenv OMP_NUM_THREADS 1
2427 if ( `uname` == AIX ) then
2428 setenv XLSMPOPTS "parthds=1"
2429 endif
2430 $MPIRUNCOMMAND ../../main/wrf_${core}.exe.$compopt $MPIRUNCOMMANDPOST
2431 mv rsl.error.0000 print.out.wrf_${core}_Phys=${phys_option}_Parallel=${compopt}
2432 endif
2433 #DAVE###################################################
2434 echo ran wrf fcst compopt = $compopt
2435 banner 17
2436 #set ans = "$<"
2437 #DAVE###################################################
2439 grep "SUCCESS COMPLETE" print.out.wrf_${core}_Phys=${phys_option}_Parallel=${compopt}
2440 set success = $status
2442 # Did making the forecast work, by that, we mean "is there an output file created", and "are there 2 times periods".
2444 if ( ( -e wrfout_d01_${filetag} ) && ( $success == 0 ) ) then
2445 if ( $IO_FORM_NAME[$IO_FORM] == io_netcdf ) then
2446 ncdump -h wrfout_d01_${filetag} | grep Time | grep UNLIMITED | grep currently | grep -q 2
2447 set ok = $status
2448 set found_nans = 1
2449 if ( `uname` == AIX ) then
2450 ncdump wrfout_d01_${filetag} | grep NaN >& /dev/null
2451 set found_nans = $status
2452 else if ( `uname` == OSF1 ) then
2453 ncdump wrfout_d01_${filetag} | grep nan >& /dev/null
2454 # set found_nans = $status
2455 else if ( `uname` == Linux ) then
2456 ncdump wrfout_d01_${filetag} | grep nan >& /dev/null
2457 set found_nans = $status
2458 endif
2459 if ( $found_nans == 0 ) then
2460 echo found nans
2461 set ok = 1
2462 endif
2464 else if ( $IO_FORM_NAME[$IO_FORM] == io_grib1 ) then
2465 # set joe_times = `../../external/io_grib1/wgrib -s -4yr wrfout_d01_${filetag} | grep -v ":anl:" | wc -l`
2466 # if ( $joe_times >= 100 ) then
2467 set joe_times = `../../external/io_grib1/wgrib -s -4yr wrfout_d01_${filetag} | grep "UGRD:10 m" | wc -l`
2468 if ( $joe_times == 2 ) then
2469 set ok = 0
2470 else
2471 set ok = 1
2472 endif
2473 endif
2474 if ( $ok == 0 ) then
2475 echo "SUMMARY generate FCST for $core physics $phys_option parallel $compopt $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
2476 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2477 else
2478 echo "SUMMARY generate FCST for $core physics $phys_option parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
2479 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2480 $MAIL -s "WRF FAIL FCST $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
2481 if ( $KEEP_ON_RUNNING == FALSE ) exit ( 5 )
2482 endif
2483 else
2484 echo "SUMMARY generate FCST for $core physics $phys_option parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
2485 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2486 $MAIL -s "WRF FAIL FCST $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
2487 if ( $KEEP_ON_RUNNING == FALSE ) exit ( 6 )
2488 endif
2489 #DAVE###################################################
2490 echo success or failure of fcst
2491 if ( $IO_FORM_NAME[$IO_FORM] == io_netcdf ) then
2492 ncdump -v Times wrfout_d01_${filetag} | tail -20
2493 endif
2494 banner 18
2495 #set ans = "$<"
2496 #DAVE###################################################
2498 # We have to save this output file for our biggy comparison after all of the
2499 # parallel options have been considered.
2501 mv wrfout_d01_${filetag} $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$compopt
2503 # To save space, we move the executables after we are finished with them.
2505 if ( $phys_option == $PHYSOPTS[${#PHYSOPTS}] ) then
2506 mv ../../main/wrf_${core}.exe.$compopt $TMPDIR/wrf_${core}.exe.$compopt
2507 endif
2509 popd
2511 BYPASS_COMP_LOOP_REAL:
2515 else if ( $core == nmm_real ) then
2516 #DAVE###################################################
2517 echo doing nmm pre no-nest
2518 banner 19
2519 #set ans = "$<"
2520 #DAVE###################################################
2522 set compopt = $COMPOPTS[3] # ! parallel only
2523 set filetag = 2005-01-23_00:00:00
2524 set phys_option=1
2525 pushd test/$core
2527 #DAVE###################################################
2528 echo did rms
2529 echo $filetag $phys_option
2530 banner 19a
2531 #set ans = "$<"
2532 #DAVE###################################################
2534 # Build NMM namelist
2536 cp ${CUR_DIR}/io_format io_format
2537 sed -e '/^ io_form_history /,/^ io_form_boundary/d' -e '/^ restart_interval/r ./io_format' \
2538 namelist.input.regtest >! namelist.input.temp
2540 # A fairly short forecast, 10 time steps
2542 sed -e 's/^ run_days *= *[0-9]*/ run_days = 0 /' \
2543 -e 's/^ run_seconds *= *[0-9]*/ run_seconds = 900 /' \
2544 -e 's/^ history_interval *= *[0-9][0-9]*/ history_interval = 15,15 /' \
2545 -e 's/^ frames_per_outfile *= [0-9]*/ frames_per_outfile = 200/g' \
2546 namelist.input.temp >! namelist.input
2548 #DAVE###################################################
2549 echo did cp of namelist no-nest
2550 ls -ls namelist.input
2551 cat namelist.input
2552 banner 19b
2553 #set ans = "$<"
2554 #DAVE###################################################
2556 # Generate IC/BC for NMM run
2558 set RUNCOMMAND = `echo $MPIRUNCOMMAND | sed "s/$Num_Procs/1/"`
2560 # Zap any old input data laying around.
2562 rm wrfinput_d01 >& /dev/null
2563 rm wrfbdy_d01 >& /dev/null
2565 $RUNCOMMAND ../../main/real_${core}.exe.$COMPOPTS[3] >! print.out.real_${core}_Phys=${phys_option}_Parallel=$COMPOPTS[3]
2566 #DAVE###################################################
2567 echo finished real no-nest
2568 banner 19c
2569 #set ans = "$<"
2570 #DAVE###################################################
2572 mv rsl.out.0000 print.out.real_${core}_Phys=${phys_option}_Parallel=${compopt}
2573 grep "SUCCESS COMPLETE" print.out.real_${core}_Phys=${phys_option}_Parallel=${compopt} >& /dev/null
2574 set success = $status
2576 # Did making the IC BC files work?
2578 if ( ( -e wrfinput_d01 ) && ( -e wrfbdy_d01 ) && ( $success == 0 ) ) then
2579 echo "SUMMARY generate IC/BC for $core physics $phys_option parallel $compopt $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
2580 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2581 else
2582 echo "SUMMARY generate IC/BC for $core physics $phys_option parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
2583 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2584 $MAIL -s "WRF FAIL making IC/BC $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
2585 if ( $KEEP_ON_RUNNING == FALSE ) exit ( 4 )
2586 endif
2587 #DAVE###################################################
2588 echo IC BC must be OK no-nest
2589 ls -lsL wrfinput* wrfb*
2590 if ( $IO_FORM_NAME[$IO_FORM] == io_netcdf ) then
2591 ncdump -v Times wrfb* | tail -20
2592 endif
2593 banner 20
2594 #set ans = "$<"
2595 #DAVE###################################################
2597 # Run on 1 and then on Num_Procs processors
2599 foreach n ( 1 $Num_Procs )
2600 #DAVE###################################################
2601 echo running nmm on $n procs no-nest
2602 banner 21
2603 #set ans = "$<"
2604 #DAVE###################################################
2606 if ( ( $n != 1 ) && ( $QUILT != TRUE ) ) then
2607 @ nmm_proc = $Num_Procs
2608 cat >! nproc_xy << EOF
2609 nproc_x = $nmm_proc
2610 nproc_y = 1
2612 sed -e '/^ numtiles/r nproc_xy' namelist.input >! file.foo
2613 mv file.foo namelist.input
2614 else if ( ( $n != 1 ) && ( $QUILT == TRUE ) ) then
2615 @ nmm_proc = $Num_Procs - 1
2616 cat >! nproc_xy << EOF
2617 nproc_x = $nmm_proc
2618 nproc_y = 1
2620 sed -e '/^ numtiles/r nproc_xy' namelist.input >! file.foo
2621 mv file.foo namelist.input
2622 endif
2624 if ( `uname` == AIX ) then
2625 set RUNCOMMAND = $MPIRUNCOMMAND
2626 else
2627 set RUNCOMMAND = `echo $MPIRUNCOMMAND | sed "s/$Num_Procs/$n/"`
2628 endif
2630 # WRF output quilt servers are only tested for MPI configuration.
2631 # Currently, only one WRF output quilt server is used.
2633 if ( ( $QUILT == TRUE ) && ( $n == $Num_Procs ) ) then
2634 if ( $compopt == $COMPOPTS[3] ) then
2635 # For now, test only one group of one output quilt servers.
2636 sed -e 's/ nio_tasks_per_group *= *[0-9]*/ nio_tasks_per_group = 1/g' \
2637 -e 's/ nio_groups *= *[0-9]*/ nio_groups = 1/g' \
2638 namelist.input >! namelist.input.temp
2639 mv -f namelist.input.temp namelist.input
2640 echo "Building namelist.input.$core.${phys_option}.$compopt with one I/O quilt server enabled."
2641 echo "NOTE one I/O quilt server enabled for $core physics $phys_option parallel $compopt..." >>! ${DEF_DIR}/wrftest.output
2642 endif
2643 endif
2645 # NMM can fail on spurious fp exceptions that don't affect soln. Retry if necessary.
2647 set tries=0
2648 while ( $tries < 2 )
2649 #DAVE###################################################
2650 echo try attempt $tries allowed to be less than 2
2651 banner 22
2652 #set ans = "$<"
2653 #DAVE###################################################
2654 @ tries = $tries + 1
2655 $RUNCOMMAND ../../main/wrf_${core}.exe.$compopt $MPIRUNCOMMANDPOST
2656 mv rsl.error.0000 print.out.wrf_${core}_Phys=${phys_option}_Parallel=${compopt}_${n}p
2657 grep "SUCCESS COMPLETE" print.out.wrf_${core}_Phys=${phys_option}_Parallel=${compopt}_${n}p
2658 set success = $status
2659 set ok = $status
2660 if ( ( -e wrfout_d01_${filetag} ) && ( $success == 0 ) ) then
2661 if ( $IO_FORM_NAME[$IO_FORM] == io_netcdf ) then
2662 ncdump -h wrfout_d01_${filetag} | grep Time | grep UNLIMITED | grep currently | grep -q 2
2663 set ok = $status
2664 set found_nans = 1
2665 if ( `uname` == AIX ) then
2666 ncdump wrfout_d01_${filetag} | grep NaN >& /dev/null
2667 set found_nans = $status
2668 else if ( `uname` == OSF1 ) then
2669 ncdump wrfout_d01_${filetag} | grep nan >& /dev/null
2670 # set found_nans = $status
2671 else if ( `uname` == Linux ) then
2672 ncdump wrfout_d01_${filetag} | grep nan >& /dev/null
2673 set found_nans = $status
2674 endif
2675 if ( $found_nans == 0 ) then
2676 echo found nans
2677 set ok = 1
2678 endif
2680 else if ( $IO_FORM_NAME[$IO_FORM] == io_grib1 ) then
2681 ../../external/io_grib1/wgrib -s -4yr wrfout_d01_${filetag} | grep "UGRD:10 m above gnd:3600 sec fcst"
2682 set ok = $status
2683 endif
2684 if ( $ok == 0 ) then
2685 echo "SUMMARY generate FCST for $core physics $phys_option parallel $compopt $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
2686 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2687 set tries=2 # success, bail from loop
2688 else
2689 echo "SUMMARY generate FCST for $core physics $phys_option parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
2690 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2691 $MAIL -s "WRF FAIL FCST $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
2692 if ( if ( $KEEP_ON_RUNNING == FALSE ) && ( $tries == 2 ) )exit ( 5 )
2693 endif
2694 else
2695 echo "SUMMARY generate FCST for $core physics $phys_option parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
2696 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2697 $MAIL -s "WRF FAIL FCST $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
2698 if ( ( $KEEP_ON_RUNNING == FALSE ) && ( $tries == 2 ) ) exit ( 6 )
2699 endif
2700 mv wrfout_d01_${filetag} $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.${compopt}_${n}p
2701 #DAVE###################################################
2702 echo did nmm fcst no-nest
2703 ls -ls $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.${compopt}_${n}p
2704 banner 23
2705 #set ans = "$<"
2706 #DAVE###################################################
2710 popd
2712 #DAVE###################################################
2713 echo doing nmm pre nesting
2714 banner 19
2715 #set ans = "$<"
2716 #DAVE###################################################
2718 set compopt = $COMPOPTS[3] # ! parallel only
2719 set filetag = 2008-03-06_00:00:00
2720 set phys_option=1
2721 pushd test/$core
2723 #DAVE###################################################
2724 echo did rms
2725 echo $filetag $phys_option
2726 banner 19a
2727 #set ans = "$<"
2728 #DAVE###################################################
2730 # Build NMM namelist
2732 cp ${CUR_DIR}/io_format io_format
2733 sed -e '/^ io_form_history /,/^ io_form_boundary/d' -e '/^ restart_interval/r ./io_format' \
2734 namelist.nest.regtest >! namelist.input.temp
2736 # A fairly short forecast, 10 time steps
2738 sed -e 's/^ run_hours *= *[0-9]*/ run_hours = 0 /' \
2739 -e 's/^ run_seconds *= *[0-9]*/ run_seconds = 900 /' \
2740 -e 's/^ history_interval *= *[0-9][0-9]*/ history_interval = 15,15 /' \
2741 -e 's/^ frames_per_outfile *= [0-9]*/ frames_per_outfile = 200/g' \
2742 namelist.input.temp >! namelist.input
2744 #DAVE###################################################
2745 echo did cp of namelist nesting
2746 ls -ls namelist.input
2747 cat namelist.input
2748 banner 19b
2749 #set ans = "$<"
2750 #DAVE###################################################
2752 # Generate IC/BC for NMM run
2754 set RUNCOMMAND = `echo $MPIRUNCOMMAND | sed "s/$Num_Procs/1/"`
2756 # Zap any old input data laying around.
2758 rm wrfinput_d01 >& /dev/null
2759 rm wrfbdy_d01 >& /dev/null
2761 $RUNCOMMAND ../../main/real_${core}.exe.$COMPOPTS[3] >! print.out.real_${core}_Phys=${phys_option}_Parallel_Nest=$COMPOPTS[3]
2762 #DAVE###################################################
2763 echo finished real nesting
2764 banner 19c
2765 #set ans = "$<"
2766 #DAVE###################################################
2768 mv rsl.out.0000 print.out.real_${core}_Phys=${phys_option}_Parallel=${compopt}
2769 grep "SUCCESS COMPLETE" print.out.real_${core}_Phys=${phys_option}_Parallel=${compopt} >& /dev/null
2770 set success = $status
2772 # Did making the IC BC files work?
2774 if ( ( -e wrfinput_d01 ) && ( -e wrfbdy_d01 ) && ( $success == 0 ) ) then
2775 echo "SUMMARY generate IC/BC for $core physics $phys_option parallel nest $compopt $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
2776 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2777 else
2778 echo "SUMMARY generate IC/BC for $core physics $phys_option parallel nest $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
2779 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2780 $MAIL -s "WRF FAIL making IC/BC $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
2781 if ( $KEEP_ON_RUNNING == FALSE ) exit ( 4 )
2782 endif
2783 #DAVE###################################################
2784 echo IC BC must be OK nesting
2785 ls -lsL wrfinput* wrfb*
2786 if ( $IO_FORM_NAME[$IO_FORM] == io_netcdf ) then
2787 ncdump -v Times wrfb* | tail -20
2788 endif
2789 banner 20
2790 #set ans = "$<"
2791 #DAVE###################################################
2793 # Run on 1 and then on Num_Procs processors
2795 #LPC
2796 foreach n ( 1 $Num_Procs )
2797 #DAVE###################################################
2798 echo running nmm on $n procs nesting
2799 banner 21
2800 #set ans = "$<"
2801 #DAVE###################################################
2803 if ( ( $n != 1 ) && ( $QUILT != TRUE ) ) then
2804 @ nmm_proc = $Num_Procs
2805 #LPC
2806 cat >! nproc_xy << EOF
2807 nproc_x = $nmm_proc
2808 nproc_y = 1
2810 sed -e '/^ numtiles/r nproc_xy' namelist.input >! file.foo
2811 mv file.foo namelist.input
2812 else if ( ( $n != 1 ) && ( $QUILT == TRUE ) ) then
2813 @ nmm_proc = $Num_Procs - 1
2814 #LPC
2815 cat >! nproc_xy << EOF
2816 nproc_x = $nmm_proc
2817 nproc_y = 1
2819 sed -e '/^ numtiles/r nproc_xy' namelist.input >! file.foo
2820 mv file.foo namelist.input
2821 endif
2823 if ( `uname` == AIX ) then
2824 set RUNCOMMAND = $MPIRUNCOMMAND
2825 else
2826 set RUNCOMMAND = `echo $MPIRUNCOMMAND | sed "s/$Num_Procs/$n/"`
2827 endif
2829 # WRF output quilt servers are only tested for MPI configuration.
2830 # Currently, only one WRF output quilt server is used.
2832 if ( ( $QUILT == TRUE ) && ( $n == $Num_Procs ) ) then
2833 if ( $compopt == $COMPOPTS[3] ) then
2834 # For now, test only one group of one output quilt servers.
2835 sed -e 's/ nio_tasks_per_group *= *[0-9]*/ nio_tasks_per_group = 1/g' \
2836 -e 's/ nio_groups *= *[0-9]*/ nio_groups = 1/g' \
2837 namelist.input >! namelist.input.temp
2838 mv -f namelist.input.temp namelist.input
2839 echo "Building namelist.input.$core.${phys_option}.$compopt with one I/O quilt server enabled."
2840 echo "NOTE one I/O quilt server enabled for $core physics $phys_option parallel $compopt..." >>! ${DEF_DIR}/wrftest.output
2841 endif
2842 endif
2844 # NMM can fail on spurious fp exceptions that don't affect soln. Retry if necessary.
2846 set tries=0
2847 while ( $tries < 2 )
2848 #DAVE###################################################
2849 echo try attempt $tries allowed to be less than 2
2850 banner 22
2851 #set ans = "$<"
2852 #DAVE###################################################
2853 @ tries = $tries + 1
2854 $RUNCOMMAND ../../main/wrf_${core}.exe.$compopt $MPIRUNCOMMANDPOST
2855 ls -lsL rsl*
2856 mv rsl.error.0000 print.out.wrf_${core}_Phys=${phys_option}_Parallel=${compopt}_${n}p
2857 grep "SUCCESS COMPLETE" print.out.wrf_${core}_Phys=${phys_option}_Parallel=${compopt}_${n}p
2858 set success = $status
2859 set ok = $status
2860 if ( ( -e wrfout_d01_${filetag} ) && ( $success == 0 ) ) then
2861 if ( $IO_FORM_NAME[$IO_FORM] == io_netcdf ) then
2862 ncdump -h wrfout_d01_${filetag} | grep Time | grep UNLIMITED | grep currently | grep -q 2
2863 set ok = $status
2864 set found_nans = 1
2865 if ( `uname` == AIX ) then
2866 ncdump wrfout_d01_${filetag} | grep NaN >& /dev/null
2867 set found_nans = $status
2868 else if ( `uname` == OSF1 ) then
2869 ncdump wrfout_d01_${filetag} | grep nan >& /dev/null
2870 # set found_nans = $status
2871 else if ( `uname` == Linux ) then
2872 ncdump wrfout_d01_${filetag} | grep nan >& /dev/null
2873 set found_nans = $status
2874 endif
2875 if ( $found_nans == 0 ) then
2876 echo found nans
2877 set ok = 1
2878 endif
2880 else if ( $IO_FORM_NAME[$IO_FORM] == io_grib1 ) then
2881 ../../external/io_grib1/wgrib -s -4yr wrfout_d01_${filetag} | grep "UGRD:10 m above gnd:3600 sec fcst"
2882 set ok = $status
2883 endif
2884 if ( $ok == 0 ) then
2885 echo "SUMMARY generate FCST for $core physics $phys_option parallel $compopt $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
2886 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2887 set tries=2 # success, bail from loop
2888 else
2889 echo "SUMMARY generate FCST for $core physics $phys_option parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
2890 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2891 $MAIL -s "WRF FAIL FCST $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
2892 if ( if ( $KEEP_ON_RUNNING == FALSE ) && ( $tries == 2 ) )exit ( 5 )
2893 endif
2894 else
2895 echo "SUMMARY generate FCST for $core physics $phys_option parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
2896 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
2897 $MAIL -s "WRF FAIL FCST $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
2898 if ( if ( $KEEP_ON_RUNNING == FALSE ) && ( $tries == 2 ) ) exit ( 6 )
2899 endif
2900 mv wrfout_d01_${filetag} $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.${compopt}_${n}p
2901 /bin/cp namelist.input $TMPDIR/namelist.input.$core.${phys_option}.$compopt
2902 #DAVE###################################################
2903 echo did nmm fcst with nesting
2904 ls -ls $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.${compopt}_${n}p
2905 banner 23
2906 #set ans = "$<"
2907 #DAVE###################################################
2911 popd
2913 else
2915 #DAVE###################################################
2916 echo doing ideal runs
2917 banner 24
2918 #set ans = "$<"
2919 #DAVE###################################################
2920 # The ideal cases have different physics tests than the real cases. If this is
2921 # more that the total number of ideal physics experiments that we were led to
2922 # believe would exist, jump to the end of the physics loop.
2924 if ( $phys_option > $Max_Ideal_Physics_Options ) then
2925 goto BOTTOM_OF_PHYSICS_LOOP
2926 endif
2928 set filetag=$filetag_ideal
2930 foreach compopt ( $COMPOPTS )
2931 #DAVE###################################################
2932 echo doing compopt = $compopt
2933 echo filetag = $filetag
2934 banner 25
2935 #set ans = "$<"
2936 #DAVE###################################################
2939 # We sometimes are interested in bypassing the OpenMP option.
2941 if ( $compopt == $COMPOPTS[2] ) then
2942 if ( $ZAP_OPENMP == TRUE ) then
2943 goto BYPASS_COMP_LOOP_IDEAL
2944 endif
2945 endif
2947 pushd test/$core
2949 if ( ! -e namelist.input.template ) cp namelist.input namelist.input.template
2951 # Create the correct namelist.input file.
2953 cp ${CUR_DIR}/dom_ideal dom_ideal
2954 if ( $core == em_quarter_ss ) then
2955 cp ${CUR_DIR}/phys_quarter_ss_${phys_option}a phys_tke
2956 cp ${CUR_DIR}/phys_quarter_ss_${phys_option}b phys_mp
2957 cp ${CUR_DIR}/phys_quarter_ss_${phys_option}c phys_nh
2958 cp ${CUR_DIR}/phys_quarter_ss_${phys_option}d phys_nest
2959 cp ${CUR_DIR}/phys_quarter_ss_${phys_option}e phys_bc
2960 cp ${CUR_DIR}/phys_quarter_ss_${phys_option}f phys_sfclay
2961 else if ( $core == em_b_wave ) then
2962 cp ${CUR_DIR}/phys_b_wave_${phys_option}a phys_tke
2963 cp ${CUR_DIR}/phys_b_wave_${phys_option}b phys_mp
2964 cp ${CUR_DIR}/phys_b_wave_${phys_option}c phys_nh
2965 cp ${CUR_DIR}/phys_b_wave_${phys_option}d phys_nest
2966 endif
2968 cp ${CUR_DIR}/io_format io_format
2969 if ( $NESTED == TRUE ) then
2970 if ( $core == em_quarter_ss ) then
2971 sed -e 's/ run_days *= *[0-9][0-9]*/ run_days = 00/g' \
2972 -e 's/ run_minutes *= *[0-9][0-9]*/ run_minutes = 1/g' \
2973 -e 's/ run_seconds *= *[0-9][0-9]*/ run_seconds = 0/g' \
2974 -e 's/ history_interval *= [0-9][0-9]*/ history_interval = 1/g' \
2975 -e 's/ frames_per_outfile *= [0-9][0-9]*/ frames_per_outfile = 100/g' \
2976 -e '/^ diff_opt/d' -e '/^ km_opt/d' -e '/^ damp_opt/d' -e '/^ rk_ord/r ./phys_tke' \
2977 -e '/^ io_form_history /,/^ io_form_boundary/d' -e '/^ restart_interval/r ./io_format' \
2978 -e '/^ mp_physics/d' -e '/^ &physics/r ./phys_mp' \
2979 -e '/^ sf_sfclay_physics/d' -e '/^ radt/r ./phys_sfclay' \
2980 -e '/^ moist_adv_opt/,/^ non_hydrostatic/d' -e '/^ v_sca_adv_order/r ./phys_nh' \
2981 -e '/^ periodic_x /,/^ open_ye/d' \
2982 -e '/^ &bdy_control/r ./phys_bc' \
2983 -e '/^ max_dom/d' -e '/^ time_step_fract_den/r ./dom_ideal' \
2984 ./namelist.input.template >! namelist.input
2985 else if ( $core == em_b_wave ) then
2986 sed -e 's/ run_days *= *[0-9][0-9]*/ run_days = 00/g' \
2987 -e 's/ run_minutes *= *[0-9][0-9]*/ run_minutes = 20/g' \
2988 -e 's/ history_interval *= [0-9][0-9]*/ history_interval = 20/g' \
2989 -e 's/ frames_per_outfile *= [0-9][0-9]*/ frames_per_outfile = 100/g' \
2990 -e '/^ diff_opt/d' -e '/^ km_opt/d' -e '/^ damp_opt/d' -e '/^ rk_ord/r ./phys_tke' \
2991 -e '/^ io_form_history /,/^ io_form_boundary/d' -e '/^ restart_interval/r ./io_format' \
2992 -e '/^ mp_physics/d' -e '/^ &physics/r ./phys_mp' \
2993 -e '/^ non_hydrostatic/d' -e '/^ v_sca_adv_order/r ./phys_nh' \
2994 -e '/^ max_dom/d' -e '/^ time_step_fract_den/r ./dom_ideal' \
2995 ./namelist.input.template >! namelist.input
2996 endif
2997 else if ( $NESTED != TRUE ) then
2998 if ( $core == em_quarter_ss ) then
2999 sed -e 's/ run_days *= *[0-9][0-9]*/ run_days = 00/g' \
3000 -e 's/ run_minutes *= *[0-9][0-9]*/ run_minutes = 2/g' \
3001 -e 's/ history_interval *= [0-9][0-9]*/ history_interval = 2/g' \
3002 -e 's/ frames_per_outfile *= [0-9][0-9]*/ frames_per_outfile = 100/g' \
3003 -e '/^ diff_opt/d' -e '/^ km_opt/d' -e '/^ damp_opt/d' -e '/^ rk_ord/r ./phys_tke' \
3004 -e '/^ io_form_history /,/^ io_form_boundary/d' -e '/^ restart_interval/r ./io_format' \
3005 -e '/^ mp_physics/d' -e '/^ &physics/r ./phys_mp' \
3006 -e '/^ sf_sfclay_physics/d' -e '/^ radt/r ./phys_sfclay' \
3007 -e '/^ moist_adv_opt/,/^ non_hydrostatic/d' -e '/^ v_sca_adv_order/r ./phys_nh' \
3008 -e '/^ periodic_x/d' -e '/^ open_xs/d' -e '/^ open_xe/d' \
3009 -e '/^ periodic_y/d' -e '/^ open_ys/d' -e '/^ open_ye/d' \
3010 -e '/^ &bdy_control/r ./phys_bc' \
3011 -e '/^ max_dom/d' -e '/^ time_step_fract_den/r ./dom_ideal' \
3012 ./namelist.input.template >! namelist.input
3013 else if ( $core == em_b_wave ) then
3014 sed -e 's/ run_days *= *[0-9][0-9]*/ run_days = 00/g' \
3015 -e 's/ run_minutes *= *[0-9][0-9]*/ run_minutes = 100/g' \
3016 -e 's/ history_interval *= [0-9][0-9]*/ history_interval = 100/g' \
3017 -e 's/ frames_per_outfile *= [0-9][0-9]*/ frames_per_outfile = 100/g' \
3018 -e '/^ diff_opt/d' -e '/^ km_opt/d' -e '/^ damp_opt/d' -e '/^ rk_ord/r ./phys_tke' \
3019 -e '/^ io_form_history /,/^ io_form_boundary/d' -e '/^ restart_interval/r ./io_format' \
3020 -e '/^ mp_physics/d' -e '/^ &physics/r ./phys_mp' \
3021 -e '/^ non_hydrostatic/d' -e '/^ v_sca_adv_order/r ./phys_nh' \
3022 -e '/^ max_dom/d' -e '/^ time_step_fract_den/r ./dom_ideal' \
3023 ./namelist.input.template >! namelist.input
3024 endif
3025 endif
3027 # WRF output quilt servers are only tested for MPI configuration.
3028 # Currently, only one WRF output quilt server is used.
3030 if ( $QUILT == TRUE ) then
3031 if ( $compopt == $COMPOPTS[3] ) then
3032 # For now, test only one group of one output quilt servers.
3033 sed -e 's/ nio_tasks_per_group *= *[0-9][0-9]*/ nio_tasks_per_group = 1/g' \
3034 -e 's/ nio_groups *= *[0-9][0-9]*/ nio_groups = 1/g' \
3035 namelist.input >! namelist.input.temp
3036 mv -f namelist.input.temp namelist.input
3037 echo "Building namelist.input.$core.${phys_option}.$compopt with one I/O quilt server enabled."
3038 echo "NOTE one I/O quilt server enabled for $core physics $phys_option parallel $compopt..." >>! ${DEF_DIR}/wrftest.output
3039 endif
3040 endif
3042 /bin/cp namelist.input $TMPDIR/namelist.input.$core.${phys_option}.$compopt
3043 #DAVE###################################################
3044 echo built namelist
3045 ls -ls namelist.input
3046 banner 26
3047 #set ans = "$<"
3048 #DAVE###################################################
3050 # If this is the serial code, generate the IC and BC. The ideal.exe program is not
3051 # parallelized, so the data is generated and saved for the rest of the parallel tests.
3053 if ( $compopt == $COMPOPTS[1] ) then
3055 # Zap any old input data laying around.
3057 rm wrfinput_d01 >& /dev/null
3058 rm wrfbdy_d01 >& /dev/null
3060 ../../main/ideal_${core}.exe.1 >! print.out.ideal_${core}_Parallel=${compopt}
3061 #DAVE###################################################
3062 echo ran ideal
3063 ls -ls wrfinput*
3064 banner 27
3065 #set ans = "$<"
3066 #DAVE###################################################
3068 grep "SUCCESS COMPLETE" print.out.ideal_${core}_Parallel=${compopt} >& /dev/null
3069 set success = $status
3071 # Did making the IC BC files work?
3073 if ( ( -e wrfinput_d01 ) && ( $success == 0 ) ) then
3074 echo "SUMMARY generate IC/BC for $core physics $phys_option parallel $compopt $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
3075 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
3076 else
3077 echo "SUMMARY generate IC/BC for $core physics $phys_option parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
3078 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
3079 $MAIL -s "WRF FAIL making IC/BC $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
3080 if ( $KEEP_ON_RUNNING == FALSE ) exit ( 7 )
3081 endif
3082 endif
3084 # Run the forecast for this core and parallel option
3086 rm $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$compopt >& /dev/null
3088 if ( $compopt == $COMPOPTS[1] ) then
3089 setenv OMP_NUM_THREADS 1
3090 if ( `uname` == AIX ) then
3091 setenv XLSMPOPTS "parthds=1"
3092 endif
3093 if ( $NESTED == TRUE ) then
3094 $SERIALRUNCOMMAND ../../main/wrf_${core}.exe.$compopt >! print.out.wrf_${core}_Parallel=${compopt}
3095 else if ( $NESTED != TRUE ) then
3096 ../../main/wrf_${core}.exe.$compopt >! print.out.wrf_${core}_Parallel=${compopt}
3097 endif
3098 else if ( $compopt == $COMPOPTS[2] ) then
3099 setenv OMP_NUM_THREADS $OPENMP
3100 if ( `uname` == AIX ) then
3101 setenv XLSMPOPTS "parthds=${OPENMP}"
3102 endif
3103 if ( $NESTED == TRUE ) then
3104 $OMPRUNCOMMAND ../../main/wrf_${core}.exe.$compopt >! print.out.wrf_${core}_Parallel=${compopt}
3105 else if ( $NESTED != TRUE ) then
3106 ../../main/wrf_${core}.exe.$compopt >! print.out.wrf_${core}_Parallel=${compopt}
3107 endif
3108 else if ( $compopt == $COMPOPTS[3] ) then
3109 setenv OMP_NUM_THREADS 1
3110 if ( `uname` == AIX ) then
3111 setenv XLSMPOPTS "parthds=1"
3112 endif
3113 $MPIRUNCOMMAND ../../main/wrf_${core}.exe.$compopt $MPIRUNCOMMANDPOST
3114 mv rsl.error.0000 print.out.wrf_${core}_Parallel=${compopt}
3115 endif
3116 #DAVE###################################################
3117 echo ran ideal fcst
3118 banner 28
3119 #set ans = "$<"
3120 #DAVE###################################################
3122 grep "SUCCESS COMPLETE" print.out.wrf_${core}_Parallel=${compopt}
3123 set success = $status
3125 # Did making the forecast work, by that, we mean "is there an output file created?"
3127 if ( ( -e wrfout_d01_${filetag} ) && ( $success == 0 ) ) then
3128 if ( $IO_FORM_NAME[$IO_FORM] == io_netcdf ) then
3129 ncdump -h wrfout_d01_${filetag} | grep Time | grep UNLIMITED | grep currently | grep -q 2
3130 set ok = $status
3131 set found_nans = 1
3132 if ( `uname` == AIX ) then
3133 ncdump wrfout_d01_${filetag} | grep NaN >& /dev/null
3134 set found_nans = $status
3135 else if ( `uname` == OSF1 ) then
3136 ncdump wrfout_d01_${filetag} | grep nan >& /dev/null
3137 # set found_nans = $status
3138 else if ( `uname` == Linux ) then
3139 ncdump wrfout_d01_${filetag} | grep nan >& /dev/null
3140 set found_nans = $status
3141 endif
3142 if ( $found_nans == 0 ) then
3143 echo found nans
3144 set ok = 1
3145 endif
3147 else if ( $IO_FORM_NAME[$IO_FORM] == io_grib1 ) then
3148 # set joe_times = `../../external/io_grib1/wgrib -s -4yr wrfout_d01_${filetag} | grep -v ":anl:" | wc -l`
3149 # if ( $joe_times >= 100 ) then
3150 set joe_times = `../../external/io_grib1/wgrib -s -4yr wrfout_d01_${filetag} | grep "UGRD:10 m" | wc -l`
3151 if ( $joe_times == 2 ) then
3152 set ok = 0
3153 else
3154 set ok = 1
3155 endif
3156 endif
3157 if ( $ok == 0 ) then
3158 echo "SUMMARY generate FCST for $core physics $phys_option parallel $compopt $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
3159 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
3160 else
3161 echo "SUMMARY generate FCST for $core physics $phys_option parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
3162 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
3163 $MAIL -s "WRF FAIL FCST $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
3164 if ( $KEEP_ON_RUNNING == FALSE ) exit ( 8 )
3165 endif
3166 else
3167 echo "SUMMARY generate FCST for $core physics $phys_option parallel $compopt $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
3168 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
3169 $MAIL -s "WRF FAIL FCST $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
3170 if ( $KEEP_ON_RUNNING == FALSE ) exit ( 9 )
3171 endif
3173 # We have to save this output file for our biggy comparison after all of the
3174 # parallel options have been considered.
3176 mv wrfout_d01_${filetag} $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$compopt
3178 # To save space, we move the executables after we are finished with them.
3180 if ( $phys_option == $Max_Ideal_Physics_Options ) then
3181 mv ../../main/wrf_${core}.exe.$compopt $TMPDIR/wrf_${core}.exe.$compopt
3182 endif
3183 #DAVE###################################################
3184 echo fcst was a success
3185 ls -ls $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$compopt
3186 if ( $IO_FORM_NAME[$IO_FORM] == io_netcdf ) then
3187 ncdump -v Times $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$compopt | tail -20
3188 endif
3189 banner 29
3190 #set ans = "$<"
3191 #DAVE###################################################
3193 popd
3195 BYPASS_COMP_LOOP_IDEAL:
3199 endif
3201 # OK, once more, we gotta check if this is a BIT4BIT run. If so then there
3202 # are a number of comparisons to do. If this is a an OPTIMIZED run, then the
3203 # comparisons will fail the bit-wise comparisons.
3205 if ( $REG_TYPE == BIT4BIT) then
3207 if ( $core == nmm_real ) then
3209 pushd ${DEF_DIR}/regression_test/WRFV3/test/$core
3210 set DIFFWRF = ${DEF_DIR}/regression_test/WRFV3/external/$IO_FORM_NAME[$IO_FORM]/diffwrf
3212 if ( ( -e $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[3]_1p ) && \
3213 ( -e $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[3]_${Num_Procs}p ) ) then
3214 set foo1 = ( ` \ls -ls $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[3]_1p `)
3215 set foo2 = ( ` \ls -ls $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[3]_${Num_Procs}p `)
3216 set size1 = $foo1[6]
3217 set size2 = $foo2[6]
3218 if ( $size1 == $size2 ) then
3219 set RIGHT_SIZE = TRUE
3220 else
3221 set RIGHT_SIZE = FALSE
3222 endif
3223 else
3224 set RIGHT_SIZE = FALSE
3225 endif
3227 # 1p vs Num_Procs MPI
3229 rm fort.88 fort.98 >& /dev/null
3230 if ( ( -e $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[3]_1p ) && \
3231 ( -e $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[3]_${Num_Procs}p ) && \
3232 ( $RIGHT_SIZE == TRUE ) ) then
3233 $DIFFWRF $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[3]_1p \
3234 $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[3]_${Num_Procs}p >& /dev/null
3235 else
3236 touch fort.88 fort.98
3237 endif
3238 if ( ! -e fort.88 ) then
3239 echo "SUMMARY 1 vs $Num_Procs MPI for $core physics $phys_option $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
3240 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
3241 else
3242 echo "SUMMARY 1 vs $Num_Procs MPI for $core physics $phys_option $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
3243 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
3244 endif
3246 popd
3248 else if ( ${#COMPOPTS} != 1 ) then
3250 # If there is only a single parallel option, then we are just trying to
3251 # build the serial code. That implies no comparisons are needed.
3253 # All of the forecasts for this set of physics and core have been
3254 # generated. We now compare the WRF model output files to see
3255 # if they are S^2D^2.
3257 pushd ${DEF_DIR}/regression_test/WRFV3/test/$core
3258 set DIFFWRF = ${DEF_DIR}/regression_test/WRFV3/external/$IO_FORM_NAME[$IO_FORM]/diffwrf
3260 # Are we skipping the OpenMP runs?
3262 if ( $ZAP_OPENMP == TRUE ) then
3263 goto BYPASS_OPENMP_SUMMARY1
3264 endif
3266 # Are the files the same size? If not, then only the initial times
3267 # will be compared. That means, on a failure to run a forecast, the
3268 # diffwrf will give a pass. We need to root out this evil.
3270 if ( ( -e $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[1] ) && \
3271 ( -e $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[2] ) ) then
3272 set foo1 = ( ` \ls -ls $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[1] `)
3273 set foo2 = ( ` \ls -ls $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[2] `)
3274 set size1 = $foo1[6]
3275 set size2 = $foo2[6]
3276 if ( $size1 == $size2 ) then
3277 set RIGHT_SIZE_OMP = TRUE
3278 else
3279 set RIGHT_SIZE_OMP = FALSE
3280 endif
3281 else
3282 set RIGHT_SIZE_OMP = FALSE
3283 endif
3285 BYPASS_OPENMP_SUMMARY1:
3287 if ( ( -e $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[1] ) && \
3288 ( -e $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[3] ) ) then
3289 set foo1 = ( ` \ls -ls $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[1] `)
3290 set foo3 = ( ` \ls -ls $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[3] `)
3291 set size1 = $foo1[6]
3292 set size3 = $foo3[6]
3293 if ( $size1 == $size3 ) then
3294 set RIGHT_SIZE_MPI = TRUE
3295 else
3296 set RIGHT_SIZE_MPI = FALSE
3297 endif
3298 else
3299 set RIGHT_SIZE_MPI = FALSE
3300 endif
3302 # Are we skipping the OpenMP runs?
3304 if ( $ZAP_OPENMP == TRUE ) then
3305 goto BYPASS_OPENMP_SUMMARY2
3306 endif
3308 # Serial vs OpenMP
3310 rm fort.88 fort.98 >& /dev/null
3311 if ( ( -e $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[1] ) && \
3312 ( -e $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[2] ) && \
3313 ( $RIGHT_SIZE_OMP == TRUE ) ) then
3314 $DIFFWRF $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[1] \
3315 $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[2] >& /dev/null
3316 else
3317 touch fort.88 fort.98
3318 endif
3319 if ( ! -e fort.88 ) then
3320 echo "SUMMARY serial vs OMP for $core physics $phys_option $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
3321 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
3322 else
3323 echo "SUMMARY serial vs OMP for $core physics $phys_option $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
3324 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
3325 endif
3327 BYPASS_OPENMP_SUMMARY2:
3329 # Serial vs MPI
3331 rm fort.88 fort.98 >& /dev/null
3332 if ( ( -e $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[1] ) && \
3333 ( -e $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[3] ) && \
3334 ( $RIGHT_SIZE_MPI == TRUE ) ) then
3335 $DIFFWRF $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[1] \
3336 $TMPDIR/wrfout_d01_${filetag}.${core}.${phys_option}.$COMPOPTS[3] >& /dev/null
3337 else
3338 touch fort.88 fort.98
3339 endif
3340 if ( ! -e fort.88 ) then
3341 echo "SUMMARY serial vs MPI for $core physics $phys_option $esmf_lib_str PASS" >>! ${DEF_DIR}/wrftest.output
3342 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
3343 else
3344 echo "SUMMARY serial vs MPI for $core physics $phys_option $esmf_lib_str FAIL" >>! ${DEF_DIR}/wrftest.output
3345 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
3346 endif
3348 popd
3350 endif
3352 # Generate and archive baseline or compare against baseline
3354 if ( $core != nmm_real ) then
3355 if ( $GENERATE_BASELINE != FALSE ) then
3356 if ( ! -d $GENERATE_BASELINE ) then
3357 echo "ERROR: Baseline directory ${GENERATE_BASELINE} does not exist" >>! \
3358 ${DEF_DIR}/wrftest.output
3359 exit ( 10 )
3360 else
3361 # Archive serial output file to baseline
3362 pushd ${DEF_DIR}/regression_test/WRFV3/test/$core
3363 set basefilenm = wrfout_d01_${filetag}.${core}.${phys_option}
3364 set basefile = ${GENERATE_BASELINE}/${basefilenm}
3365 set outfile = $TMPDIR/${basefilenm}.$COMPOPTS[1]
3366 if ( -e $outfile ) then
3367 cp $outfile $basefile || \
3368 ( echo "ERROR: cannot copy ${outfile} to ${basefile}" >>! \
3369 ${DEF_DIR}/wrftest.output; exit 10 )
3370 else
3371 echo "ERROR: Cannot archive baseline, file $outfile does not exist" >>! \
3372 ${DEF_DIR}/wrftest.output
3373 echo "SUMMARY baseline archived in ${GENERATE_BASELINE} for $core physics $phys_option FAIL" >>! \
3374 ${DEF_DIR}/wrftest.output
3375 echo "-------------------------------------------------------------" >> \
3376 ${DEF_DIR}/wrftest.output
3377 exit ( 10 )
3378 endif
3379 echo "SUMMARY baseline archived in ${GENERATE_BASELINE} for $core physics $phys_option PASS" >>! \
3380 ${DEF_DIR}/wrftest.output
3381 echo "-------------------------------------------------------------" >> \
3382 ${DEF_DIR}/wrftest.output
3383 popd
3384 endif
3385 endif
3386 if ( $COMPARE_BASELINE != FALSE ) then
3387 if ( ! -d $COMPARE_BASELINE ) then
3388 echo "${0}: ERROR:: Baseline directory ${COMPARE_BASELINE} does not exist" >>! \
3389 ${DEF_DIR}/wrftest.output
3390 exit ( 10 )
3391 else
3392 # Compare against baseline output file
3393 set basefilenm = wrfout_d01_${filetag}.${core}.${phys_option}
3394 set basefile = ${COMPARE_BASELINE}/${basefilenm}
3395 set DIFFWRF = ${DEF_DIR}/regression_test/WRFV3/external/$IO_FORM_NAME[$IO_FORM]/diffwrf
3396 set testdir = ${DEF_DIR}/regression_test/WRFV3/test/$core
3397 pushd ${testdir}
3398 foreach compopt ( $COMPOPTS )
3399 set cmpfile = $TMPDIR/${basefilenm}.$compopt
3400 rm fort.88 fort.98 >& /dev/null
3401 if ( ( -e ${basefile} ) && ( -e ${cmpfile} ) ) then
3402 # Are the files the same size? If not, then only the initial times
3403 # will be compared. That means, on a failure to run a forecast, the
3404 # diffwrf will give a pass. We need to root out this evil.
3405 set foob = ( ` \ls -ls ${basefile} `)
3406 set fooc = ( ` \ls -ls ${cmpfile} `)
3407 set sizeb = $foob[6]
3408 set sizec = $fooc[6]
3409 if ( $sizeb == $sizec ) then
3410 $DIFFWRF ${basefile} ${cmpfile} >& /dev/null
3411 if ( -e fort.88 ) then
3412 echo "FAIL: Baseline comparison, file ${cmpfile} did not match ${basefile} according to diffwrf" >>! \
3413 ${DEF_DIR}/wrftest.output
3414 endif
3415 else
3416 touch fort.88 fort.98
3417 echo "FAIL: Baseline comparison, files ${cmpfile} and ${basefile} have different sizes" >>! \
3418 ${DEF_DIR}/wrftest.output
3419 endif
3420 else
3421 echo "FAIL: Baseline comparison, either ${cmpfile} or ${basefile} does not exist" >>! \
3422 ${DEF_DIR}/wrftest.output
3423 touch fort.88 fort.98
3424 endif
3425 if ( ! -e fort.88 ) then
3426 echo "SUMMARY compare vs baseline ${COMPARE_BASELINE} for $core physics $phys_option compopt $compopt $esmf_lib_str PASS" >>! \
3427 ${DEF_DIR}/wrftest.output
3428 echo "-------------------------------------------------------------" >> \
3429 ${DEF_DIR}/wrftest.output
3430 else
3431 echo "SUMMARY compare vs baseline ${COMPARE_BASELINE} for $core physics $phys_option compopt $compopt $esmf_lib_str FAIL" >>! \
3432 ${DEF_DIR}/wrftest.output
3433 echo "-------------------------------------------------------------" >> \
3434 ${DEF_DIR}/wrftest.output
3435 endif
3437 popd
3438 endif
3439 endif
3440 else if ( $core == nmm_real ) then
3441 if ( $GENERATE_BASELINE != FALSE ) then
3442 if ( ! -d $GENERATE_BASELINE ) then
3443 echo "ERROR: Baseline directory ${GENERATE_BASELINE} does not exist" >>! \
3444 ${DEF_DIR}/wrftest.output
3445 exit ( 10 )
3446 else
3447 # Archive serial output file to baseline
3448 pushd ${DEF_DIR}/regression_test/WRFV3/test/$core
3449 set basefilenm = wrfout_d01_${filetag}.${core}.${phys_option}
3450 set basefile = ${GENERATE_BASELINE}/${basefilenm}
3451 set outfile = $TMPDIR/${basefilenm}.$COMPOPTS[3]_1p
3452 if ( -e $outfile ) then
3453 cp $outfile $basefile || \
3454 ( echo "ERROR: cannot copy ${outfile} to ${basefile}" >>! \
3455 ${DEF_DIR}/wrftest.output; exit 10 )
3456 else
3457 echo "ERROR: Cannot archive baseline, file $outfile does not exist" >>! \
3458 ${DEF_DIR}/wrftest.output
3459 echo "SUMMARY baseline archived in ${GENERATE_BASELINE} for $core physics $phys_option FAIL" >>! \
3460 ${DEF_DIR}/wrftest.output
3461 echo "-------------------------------------------------------------" >> \
3462 ${DEF_DIR}/wrftest.output
3463 exit ( 10 )
3464 endif
3465 echo "SUMMARY baseline archived in ${GENERATE_BASELINE} for $core physics $phys_option PASS" >>! \
3466 ${DEF_DIR}/wrftest.output
3467 echo "-------------------------------------------------------------" >> \
3468 ${DEF_DIR}/wrftest.output
3469 popd
3470 endif
3471 endif
3472 if ( $COMPARE_BASELINE != FALSE ) then
3473 if ( ! -d $COMPARE_BASELINE ) then
3474 echo "${0}: ERROR:: Baseline directory ${COMPARE_BASELINE} does not exist" >>! \
3475 ${DEF_DIR}/wrftest.output
3476 exit ( 10 )
3477 else
3478 # Compare against baseline output file
3479 set basefilenm = wrfout_d01_${filetag}.${core}.${phys_option}
3480 set basefile = ${COMPARE_BASELINE}/${basefilenm}
3481 set DIFFWRF = ${DEF_DIR}/regression_test/WRFV3/external/$IO_FORM_NAME[$IO_FORM]/diffwrf
3482 set testdir = ${DEF_DIR}/regression_test/WRFV3/test/$core
3483 pushd ${testdir}
3484 set compopt = $COMPOPTS[3]
3485 foreach proc ( 1p 4p )
3486 set cmpfile = $TMPDIR/${basefilenm}.${compopt}_${proc}
3487 rm fort.88 fort.98 >& /dev/null
3488 if ( ( -e ${basefile} ) && ( -e ${cmpfile} ) ) then
3489 # Are the files the same size? If not, then only the initial times
3490 # will be compared. That means, on a failure to run a forecast, the
3491 # diffwrf will give a pass. We need to root out this evil.
3492 set foob = ( ` \ls -ls ${basefile} `)
3493 set fooc = ( ` \ls -ls ${cmpfile} `)
3494 set sizeb = $foob[6]
3495 set sizec = $fooc[6]
3496 if ( $sizeb == $sizec ) then
3497 $DIFFWRF ${basefile} ${cmpfile} >& /dev/null
3498 if ( -e fort.88 ) then
3499 echo "FAIL: Baseline comparison, file ${cmpfile} did not match ${basefile} according to diffwrf" >>! \
3500 ${DEF_DIR}/wrftest.output
3501 endif
3502 else
3503 touch fort.88 fort.98
3504 echo "FAIL: Baseline comparison, files ${cmpfile} and ${basefile} have different sizes" >>! \
3505 ${DEF_DIR}/wrftest.output
3506 endif
3507 else
3508 echo "FAIL: Baseline comparison, either ${cmpfile} or ${basefile} does not exist" >>! \
3509 ${DEF_DIR}/wrftest.output
3510 touch fort.88 fort.98
3511 endif
3512 if ( ! -e fort.88 ) then
3513 echo "SUMMARY compare vs baseline ${COMPARE_BASELINE} for $core physics $phys_option compopt $compopt $esmf_lib_str PASS" >>! \
3514 ${DEF_DIR}/wrftest.output
3515 echo "-------------------------------------------------------------" >> \
3516 ${DEF_DIR}/wrftest.output
3517 else
3518 echo "SUMMARY compare vs baseline ${COMPARE_BASELINE} for $core physics $phys_option compopt $compopt $esmf_lib_str FAIL" >>! \
3519 ${DEF_DIR}/wrftest.output
3520 echo "-------------------------------------------------------------" >> \
3521 ${DEF_DIR}/wrftest.output
3522 endif
3524 popd
3525 endif
3526 endif
3527 goto ALL_SHE_WROTE_FOR_NMM
3528 endif
3529 # End of generate and archive baseline or compare against baseline
3531 endif
3533 BOTTOM_OF_PHYSICS_LOOP:
3537 ALL_SHE_WROTE_FOR_NMM:
3539 echo "-------------------------------------------------------------" >> ${DEF_DIR}/wrftest.output
3541 if ( $clrm ) then
3542 popd
3543 endif
3548 # How long did this take.
3550 set end = ( `date` )
3551 echo "Start WRF Regression: $start " >> ${DEF_DIR}/wrftest.output
3552 echo "End WRF Regression: $end " >> ${DEF_DIR}/wrftest.output
3554 # We have done all of the tests, and placed the PASS FAIL labels in the
3555 # output file. If there are any FAIL messages, we are in trouble.
3557 grep FAIL ${DEF_DIR}/wrftest.output
3558 set ok = $status
3560 # Send email of the status.
3562 if ( $ok == 0 ) then
3563 $MAIL -s "REGRESSION FAILURE $ARCH[1] " $FAIL_MAIL < ${DEF_DIR}/wrftest.output
3564 else
3565 $MAIL -s "REGRESSION SUCCESS $ARCH[1] " $GOOD_MAIL < ${DEF_DIR}/wrftest.output
3566 endif
3568 # Clean left up detritus
3570 cd $CUR_DIR
3572 rm -rf damp_*eal >& /dev/null
3573 rm -rf dom_*eal >& /dev/null
3574 rm -rf phys_real_* >& /dev/null
3575 rm -rf nest_real_* >& /dev/null
3576 rm -rf phys_quarter_* >& /dev/null
3577 rm -rf phys_b_wave_* >& /dev/null
3578 rm -rf version_info >& /dev/null
3579 rm -rf machfile >& /dev/null
3580 rm -rf fdda_real* >& /dev/null
3581 rm -rf time_real_* >& /dev/null
3582 rm -rf dyn_real_* >& /dev/null
3583 rm -rf damp_* >& /dev/null
3584 rm -rf io_format >& /dev/null