-
Notifications
You must be signed in to change notification settings - Fork 1
/
gcm_CPLFCST360S2S_setup
executable file
·2742 lines (2373 loc) · 92 KB
/
gcm_CPLFCST360S2S_setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/tcsh -f
#######################################################################
# Define Colors
# Note: For No Colors, set C1 and C2 to NONE
#######################################################################
set BLACK = "\033[30m"
set RED = "\033[31m"
set GREEN = "\033[32m"
set YELLOW = "\033[33m"
set BLUE = "\033[34m"
set MAGENTA = "\033[35m"
set CYAN = "\033[36m"
set WHITE = "\033[37m"
set RESET = "\033[0m"
set BOLD = "\033[1m"
set COLORS = `echo $BLACK $RED $GREEN $YELLOW $BLUE $MAGENTA $CYAN $WHITE $RESET`
if( -e $HOME/.GCMSETUP ) then
set GCMSETUPinfo = `cat $HOME/.GCMSETUP`
set C1 = $GCMSETUPinfo[1]
set C2 = $GCMSETUPinfo[2]
else
set C1 = $RED
set C2 = $BLUE
endif
set CN = $RESET
#######################################################################
# Set Directory Locations specific to coupled forecast
#######################################################################
set FCSTBLD = '/discover/nobackup/projects/gmao/m2oasf/build/geos-s2s/GEOSodas/src'
set SUBSEASONAL = @FCSTSUBX
set QUEUENAME = @FCSTQUEUENAME
set ARCHBASEN = @FCSTARCHIVE
set FCSTBASE = "$GEOSS2S"
set setupFNM = "gcm_CPLFCST360S2S_setup"
set fcstsegm=00000045
if ($SUBSEASONAL == TRUE) then
set maxmonths=3
set ARCHBASE = "/archive/u/gmaofcst/${ARCHBASEN}/subseasonal"
else
set maxmonths=10
set ARCHBASE = "/archive/u/gmaofcst/${ARCHBASEN}/seasonal"
endif
#######################################################################
# Build Directory Locations
#######################################################################
# Set Current Working Path to gcm_setup
# -------------------------------------
set GCMSETUP = `which $0`
set root = `echo $GCMSETUP | cut -d / -f1`
if($root == . ) set GCMSETUP = `echo $cwd`/gcm_setup
set root = `echo $GCMSETUP | cut -b1`
if( "$root" != "/" ) set GCMSETUP = `echo $cwd`/$GCMSETUP
# Overwrite GCMSETUP for coupled forecast and define the coupled forecast (seasonal/subseasonal)
# -------------------------------------
set GCMSETUP = "${FCSTBLD}/Applications/GEOSgcm_App/${setupFNM}"
# Set Default GEOS Build Directory
# --------------------------------
@ n = 1
set root = `echo $GCMSETUP | cut -d / -f$n`
while( .$root == . )
@ n = $n + 1
set root = `echo $GCMSETUP | cut -d / -f$n`
end
set GEOSDEF = ''
while( $root != 'src' )
set GEOSDEF = `echo ${GEOSDEF}/${root}`
@ n = $n + 1
set root = `echo $GCMSETUP | cut -d / -f$n`
end
# Set Applications Directory
# --------------------------
@ n = 1
set root = `echo $GCMSETUP | cut -d / -f$n`
while( .$root == . )
@ n = $n + 1
set root = `echo $GCMSETUP | cut -d / -f$n`
end
set APPDIR = ''
#while( $root != 'gcm_CPLFCST_setup' )
while( $root != ${setupFNM} )
set APPDIR = `echo ${APPDIR}/${root}`
@ n = $n + 1
set root = `echo $GCMSETUP | cut -d / -f$n`
end
#######################################################################
# Test for Command Line Flags
#######################################################################
# Set default behavior of switches
set NOCVS = TRUE
set GPU = FALSE
set LINKX = FALSE
set ENSM = @FCSTMEMBER
while ( $#argv > 0 )
set arg = $argv[1]
shift argv
switch ( $arg )
# Set 1 digit ensemble member number
case -[Ee][1-9]:
set ENSM = `echo $arg | cut -c3-4`
breaksw
# Set 2 digit ensemble member number
case -[Ee][1-9][0-9]:
set ENSM = `echo $arg | cut -c3-4`
breaksw
# Set our colors
case -[Cc]:
case --[Cc][Oo][Ll][Oo][Rr]:
goto SETCOLOR
# Run the gpu code
case -[Gg]:
case --[Gg][Pp][Uu]:
# If we get here, the environment is (probably) right for GPUs
set GPU = TRUE
breaksw
# Do not archive the source
case --nocvs:
set NOCVS = TRUE
breaksw
# Symlink GEOSgcm.x
case --link:
set LINKX = TRUE
breaksw
# Here any string not above will trigger USAGE
case -[Hh]:
case --[Hh][Ee][Ll][Pp]:
default:
goto USAGE
endsw
end
#######################################################################
# CVS: Use CVS functionality only at NCCS or NAS
#######################################################################
setenv NODE `uname -n`
setenv SITE `$GEOSDEF/src/g5_modules site`
if ( $SITE != 'NCCS' && $SITE != 'NAS' ) then
set NOCVS = TRUE
echo "SCRIPTS NOCVS VALUE1= ${NOCVS}"
endif
#######################################################################
# CVS: Test for Environment Variable
#######################################################################
if ( $?ESMA_NOCVS ) then
set NOCVS = TRUE
echo "SCRIPTS NOCVS VALUE2= ${NOCVS}"
endif
# FOR COUPLED WE WANT NOCVS=TRUE JM
set NOCVS = TRUE
#######################################################################
# CVS: Test if we are on a compute node
#######################################################################
if ( $NOCVS != "TRUE" ) then
if ( $SITE == 'NCCS' ) then
if ( ($NODE =~ borg*) || ($NODE =~ warp*) ) then
goto ONCOMPUTE
endif
else if ( $SITE == 'NAS' ) then
if ( ($NODE =~ r[0-9]*i[0-9]*n[0-9]*) || ($NODE =~ maia*) ) then
goto ONCOMPUTE
endif
endif
endif
#######################################################################
# Test for Compiler and MPI Setup
#######################################################################
set BASEDIR = `$GEOSDEF/src/g5_modules basedir`
if ( `echo $BASEDIR | grep -i ifort` != '') then
set COMPILER = ifort
else if ( `echo $BASEDIR | grep -i pgfortran` != '') then
set COMPILER = pgfortran
else
# Assume default is ifort in case of older baselibs
set COMPILER = ifort
endif
if ( `echo $BASEDIR | grep -i mvapich2` != '') then
set MPI = mvapich2
else if ( `echo $BASEDIR | grep -i openmpi` != '') then
set MPI = openmpi
else if ( `echo $BASEDIR | grep -i impi` != '') then
set MPI = intelmpi
else if ( `echo $BASEDIR | grep -i intelmpi` != '') then
set MPI = intelmpi
else if ( `echo $BASEDIR | grep -i mpt` != '') then
set MPI = mpt
else
# Assume default is Intel MPI in case of older baselibs
set MPI = intelmpi
endif
#######################################################################
# Set up RUN_CMD for MPI Stack
#######################################################################
if ( $MPI == mvapich2 ) then
setenv RUN_CMD 'mpirun_rsh -export -hostfile $PBS_NODEFILE -np ' # mpi run for MVAPICH2
else if ( $MPI == openmpi ) then
if ( $SITE == 'NCCS' && $COMPILER == 'pgfortran') then
setenv RUN_CMD 'mpirun -bind-to core --mca btl ^openib --mca btl_tcp_if_include ib0 -np ' # mpi run for OpenMPI
else
setenv RUN_CMD 'mpirun -bind-to core -np ' # mpi run for OpenMPI
endif
else if ( $MPI == intelmpi ) then
setenv RUN_CMD 'mpirun -np ' # mpi run for Intel MPI
else if ( $MPI == mpt ) then
setenv RUN_CMD 'mpiexec_mpt -np ' # mpi run for MPT
endif
#######################################################################
# Enter Experiment Specific Run Parameters
# For coupled forecast interactive mode is either turned OFF or DISABLED STOPPED HERE ON SEP 26
#######################################################################
echo
echo "Enter the ${C1}Experiment ID${CN}:"
set ICDATE = @FCSTIC
set EXPYR = `echo $ICDATE | cut -c1-4`
set EXPMO = `echo $ICDATE | cut -c5-6`
set EXPDD = `echo $ICDATE | cut -c7-8`
if ($EXPMO == '01') set EXPID='jan'$EXPDD
if ($EXPMO == '02') set EXPID='feb'$EXPDD
if ($EXPMO == '03') set EXPID='mar'$EXPDD
if ($EXPMO == '04') set EXPID='apr'$EXPDD
if ($EXPMO == '05') set EXPID='may'$EXPDD
if ($EXPMO == '06') set EXPID='jun'$EXPDD
if ($EXPMO == '07') set EXPID='jul'$EXPDD
if ($EXPMO == '08') set EXPID='aug'$EXPDD
if ($EXPMO == '09') set EXPID='sep'$EXPDD
if ($EXPMO == '10') set EXPID='oct'$EXPDD
if ($EXPMO == '11') set EXPID='nov'$EXPDD
if ($EXPMO == '12') set EXPID='dec'$EXPDD
echo "ENTERED $EXPID FOR $EXPYR"
echo
echo "SETTING END DATES"
echo "FOR 45-DAY SUB-SEASONAL: max months= 3"
echo "FOR 9- MONTHS-SEASONAL: max months= 9"
@ ENDM2 = $EXPMO + $maxmonths
@ ENDY2 = $EXPYR
if ($ENDM2 > 12) then
@ ENDM2 = $ENDM2 - 12
@ ENDY2 = $EXPYR + 1
endif
if ($ENDM2 < 10) then
set END_DATE2 = "${ENDY2}0${ENDM2}01 210000"
else
set END_DATE2 = "${ENDY2}${ENDM2}01 210000"
endif
echo "END DATE BEFORE ${END_DATE2}"
echo
DESC:
echo "Enter a 1-line ${C1}Experiment Description${CN}:"
set EXPTMP = @FCSTXX
if( $#EXPTMP == 0 ) goto DESC
set EXPDSC = $EXPTMP[1]
foreach WORD ($EXPTMP)
if( $WORD != $EXPDSC ) set EXPDSC = `echo ${EXPDSC}_${WORD}`
end
echo "ENTERED $EXPDSC"
echo
GEOSTAG:
set GEOSTAG = `cat $APPDIR/.AGCM_VERSION`
#echo "${C1}CVS BASE Source Tag${CN} used for Experiment: ${C2}${GEOSTAG}${CN}"
#######################################################################
# Test to see if you want to CLONE old experiment
#######################################################################
# Check for CLONE
# ---------------
ASKCLONE:
echo "Do you wish to ${C1}CLONE${CN} an old experiment? (Default: ${C2}NO${CN} or ${C2}FALSE${CN})"
set KLONE = "NO"
if( .$KLONE == . ) then
set KLONE = FALSE
else
set KLONE = `echo $KLONE | tr "[:lower:]" "[:upper:]"`
if( $KLONE == "Y" | \
$KLONE == "YES" | \
$KLONE == "T" | \
$KLONE == "TRUE" ) set KLONE = TRUE
if( $KLONE == "N" | \
$KLONE == "NO" | \
$KLONE == "F" | \
$KLONE == "FALSE" ) set KLONE = FALSE
if( $KLONE != "TRUE" & $KLONE != "FALSE" ) then
echo
echo "${C1}CLONE${CN} must be set equal to ${C2}TRUE${CN} or ${C2}FALSE${CN}!"
goto ASKCLONE
else if ( $KLONE == "TRUE" ) then
goto DOCLONE
endif
endif
echo "ENTERED $KLONE"
#######################################################################
# Continue to enter in experiment parameters
#######################################################################
HRCODE:
echo "Enter the ${C1}Atmospheric Horizontal Resolution${CN} code:"
echo "-----------------------------------------------------------"
echo " Lat/Lon Cubed-Sphere"
echo "-----------------------------------------------------------"
echo " ${C2}b -- 2 deg ${CN} ${C2}c48 -- 2 deg ${CN}"
echo " ${C2}c -- 1 deg ${CN} ${C2}c90 -- 1 deg ${CN}"
echo " ${C2}d -- 1/2 deg ${CN} ${C2}c180 -- 1/2 deg (${C1}56-km${C2}) ${CN}"
echo " ${C2}e -- 1/4 deg (${C1}35-km${C2}) c360 -- 1/4 deg (${C1}28-km${C2}) ${CN} "
echo " ${C2} c720 -- 1/8 deg (${C1}14-km${C2}) ${CN}"
echo " ${C2} c1440 - 1/16 deg (${C1} 7-km${C2}) ${CN}"
echo " "
set HRCODE = `echo c180`
set HRCODE = `echo $HRCODE | tr "[:upper:]" "[:lower:]"`
if( $HRCODE != 'a' & \
$HRCODE != 'b' & \
$HRCODE != 'c' & \
$HRCODE != 'd' & \
$HRCODE != 'e' & \
$HRCODE != 'c12' & \
$HRCODE != 'c24' & \
$HRCODE != 'c48' & \
$HRCODE != 'c90' & \
$HRCODE != 'c180' & \
$HRCODE != 'c360' & \
$HRCODE != 'c720' & \
$HRCODE != 'c1440' ) goto HRCODE
if( $HRCODE == 'c12' | \
$HRCODE == 'c24' | \
$HRCODE == 'c48' | \
$HRCODE == 'c90' | \
$HRCODE == 'c180' | \
$HRCODE == 'c360' | \
$HRCODE == 'c720' | \
$HRCODE == 'c1440' ) then
set Resolution = $HRCODE
else
if( $HRCODE == 'a' ) set Resolution = `echo 72 46`
if( $HRCODE == 'b' ) set Resolution = `echo 144 91`
if( $HRCODE == 'c' ) set Resolution = `echo 288 181`
if( $HRCODE == 'd' ) set Resolution = `echo 576 361`
if( $HRCODE == 'e' ) set Resolution = `echo 1152 721`
endif
echo "ENTERED $HRCODE"
echo
if( $#Resolution == 2 ) then
set AGCM_IM = $Resolution[1]
set AGCM_JM = $Resolution[2]
set CUBED = FALSE
set DYCORE = FV
else
set CUBED = TRUE
set DYCORE = FV3
if (`echo $Resolution[1] | cut -b1` == "c" ) then
set AGCM_IM = $Resolution[1]
else
set AGCM_IM = "c$Resolution[1]"
endif
endif
echo "Enter the Atmospheric Model ${C1}Vertical Resolution${CN}: ${C2}LM${CN} (Default: 72)"
set AGCM_LM = 72
if( .$AGCM_LM == . ) then
set AGCM_LM = 72
endif
echo "ENTERED $AGCM_LM"
echo
#######################################################################
# Check for COUPLED Ocean
#######################################################################
OGCM:
echo "Do you wish to run the ${C1}COUPLED${CN} Ocean/Sea-Ice Model? (Default: ${C2}NO${CN} or ${C2}FALSE${CN})"
set OGCM = "YES"
if( .$OGCM == . ) then
set OGCM = FALSE
else
set OGCM = `echo $OGCM | tr "[:lower:]" "[:upper:]"`
if( $OGCM == "Y" | \
$OGCM == "YES" | \
$OGCM == "T" | \
$OGCM == "TRUE" ) set OGCM = TRUE
if( $OGCM == "N" | \
$OGCM == "NO" | \
$OGCM == "F" | \
$OGCM == "FALSE" ) set OGCM = FALSE
if( $OGCM != TRUE & $OGCM != FALSE ) then
echo
echo "${C1}COUPLED${CN} must be set equal to TRUE or FALSE!"
goto OGCM
else
echo
endif
endif
echo "ENTERED $OGCM"
echo
set CLDMICRO = "1MOMENT"
if( $OGCM == TRUE ) then
set COUPLED = ""
set FORCAST = ""
set OGRIDTYP = "TM"
set DATAOCEAN = "#DELETE"
set CLDMICRO = "2MOMENT"
# Coupled Ocean Resolution
# ------------------------
CORSLV:
echo "Enter the Ocean Lat/Lon ${C1}Horizontal Resolution${CN}: ${C2}IM JM${CN} (Default: 360 200)"
set Resolution = `echo 720 410`
set num = $#Resolution
if( $num == 2 ) then
set OGCM_IM = $Resolution[1]
set OGCM_JM = $Resolution[2]
else
if( $num == 0 ) then
set OGCM_IM = 360
set OGCM_JM = 200
else
goto CORSLV
endif
endif
set IMO = ${OGCM_IM}
set JMO = ${OGCM_JM}
if( $IMO < 10 ) set IMO = 000$IMO
if( $IMO < 100 ) set IMO = 00$IMO
if( $IMO < 1000 ) set IMO = 0$IMO
if( $JMO < 10 ) set JMO = 000$JMO
if( $JMO < 100 ) set JMO = 00$JMO
if( $JMO < 1000 ) set JMO = 0$JMO
set OCEANtag = TM${IMO}xPE${JMO}
set BCSTAG = Ganymed-4_0_Reynolds
set SSTNAME = "#DELETE"
set SSTFILE = "#DELETE"
set ICEFILE = "#DELETE"
set KPARFILE = SEAWIFS_KPAR_mon_clim.${OGCM_IM}x${OGCM_JM}
set OSTIA = "#DELETE"
echo "Enter the Ocean Model ${C1}Vertical Resolution${CN}: ${C2}LM${CN} (Default: 50)"
set OGCM_LM = 40
if( .$OGCM_LM == . ) then
set OGCM_LM = 50
endif
echo "ENTERED $OGCM_LM"
echo
set OGCM_GRIDSPEC = tripolar_${OGCM_IM}x${OGCM_JM}.ascii
set OGCM_NX = 36
set OGCM_NY = 10
@ OGCM_NPROCS = $OGCM_NX * $OGCM_NY
else
# OGCM = FALSE (Data Ocean Resolution)
# ------------------------------------
DORSLV:
echo "Enter the ${C1}Data_Ocean Horizontal Resolution ${CN}code: ${C2}o1${CN} (1 -deg, 360x180 Reynolds) Default"
echo " ${C2}o2${CN} (1/4-deg, 1440x720 MERRA-2)"
echo " ${C2}o3${CN} (1/8-deg, 2880x1440 OSTIA)"
set HRCODE = `echo $<`
if( .$HRCODE == . ) set HRCODE = o1
set HRCODE = `echo $HRCODE | tr "[:upper:]" "[:lower:]"`
if( $HRCODE != 'o1' & \
$HRCODE != 'o2' & \
$HRCODE != 'o3' ) goto DORSLV
if( $HRCODE == 'o1' ) then
set Resolution = `echo 360 180`
set OGCM_IM = $Resolution[1]
set OGCM_JM = $Resolution[2]
set BCSTAG = Ganymed-4_0_Reynolds
set SSTNAME = SST
set SSTFILE = dataoceanfile_MERRA_sst_1971-current.${OGCM_IM}x${OGCM_JM}.LE
set ICEFILE = dataoceanfile_MERRA_fraci_1971-current.${OGCM_IM}x${OGCM_JM}.LE
set KPARFILE = SEAWIFS_KPAR_mon_clim.${OGCM_IM}x${OGCM_JM}
set OSTIA = "#DELETE"
endif
if( $HRCODE == 'o2' ) then
set Resolution = `echo 1440 720`
set OGCM_IM = $Resolution[1]
set OGCM_JM = $Resolution[2]
set BCSTAG = Ganymed-4_0_MERRA-2
set SSTNAME = MERRA2
set SSTFILE = dataoceanfile_MERRA2_SST.${OGCM_IM}x${OGCM_JM}.\${YEAR}.data
set ICEFILE = dataoceanfile_MERRA2_ICE.${OGCM_IM}x${OGCM_JM}.\${YEAR}.data
set KPARFILE = SEAWIFS_KPAR_mon_clim.${OGCM_IM}x${OGCM_JM}
set OSTIA = ""
endif
if( $HRCODE == 'o3' ) then
set Resolution = `echo 2880 1440`
set OGCM_IM = $Resolution[1]
set OGCM_JM = $Resolution[2]
set BCSTAG = Ganymed-4_0_Ostia
set SSTNAME = OSTIA_REYNOLDS
set SSTFILE = dataoceanfile_OSTIA_REYNOLDS_SST.${OGCM_IM}x${OGCM_JM}.\${YEAR}.data
set ICEFILE = dataoceanfile_OSTIA_REYNOLDS_ICE.${OGCM_IM}x${OGCM_JM}.\${YEAR}.data
set KPARFILE = SEAWIFS_KPAR_mon_clim.${OGCM_IM}x${OGCM_JM}
set OSTIA = ""
endif
set IMO = ${OGCM_IM}
set JMO = ${OGCM_JM}
if( $IMO < 10 ) set IMO = 000$IMO
if( $IMO < 100 ) set IMO = 00$IMO
if( $IMO < 1000 ) set IMO = 0$IMO
if( $JMO < 10 ) set JMO = 000$JMO
if( $JMO < 100 ) set JMO = 00$JMO
if( $JMO < 1000 ) set JMO = 0$JMO
set DATAOCEAN = ""
set OGCM_LM = 34
set COUPLED = "#DELETE"
set OGRIDTYP = "DE"
set OCEANtag = DE${IMO}xPE${JMO}
set OGCM_NX = ""
set OGCM_NY = ""
set OGCM_GRIDSPEC = ""
set OGCM_NPROCS = ""
endif
# Set DEFAULT SHMEM Parameter
# ---------------------------
set USE_SHMEM = 0
# Set IAU-Forcing and Bias Correction OFF
# ---------------------------------------
set FORCEDAS = "#"
set FORCEGCM = "#"
# Set Default Readers and Writers
# -------------------------------
set NUM_READERS = 1
set NUM_WRITERS = 1
# Default Run Parameters
# ----------------------
if( $AGCM_IM == "c12" ) then
set DT = 900
set SOLAR_DT = 3600
set IRRAD_DT = 3600
set OCEAN_DT = $IRRAD_DT
set CHEM_DT = $DT
set AGCM_IM = 12
set AGCM_JM = `expr $AGCM_IM \* 6`
set NX = 2
set NY = `expr $NX \* 6`
set HYDROSTATIC = TRUE
set HIST_IM = `expr $AGCM_IM \* 4`
set HIST_JM = `expr $AGCM_IM \* 2 + 1`
set GRID_FILE = "Gnomonic_c${AGCM_IM}.dat"
set JOB_SGMT = 00000015
set NUM_SGMT = 20
set ATMOStag = CF0012x6C
set POST_NDS = 4
endif
if( $AGCM_IM == "72" ) then
set DT = 900
set SOLAR_DT = 3600
set IRRAD_DT = 3600
set CHEM_DT = $DT
set JOB_SGMT = 00000015
set NUM_SGMT = 20
if( $OGCM == TRUE ) then
set NX = $OGCM_NX
set NY = $OGCM_NY
set OCEAN_DT = $DT
else
set NX = 4
set NY = 12
set OCEAN_DT = $IRRAD_DT
endif
set ATMOStag = DC0072xPC0046
set POST_NDS = 4
endif
if( $AGCM_IM == "c24" ) then
set DT = 900
set SOLAR_DT = 3600
set IRRAD_DT = 3600
set OCEAN_DT = $IRRAD_DT
set CHEM_DT = $DT
set AGCM_IM = 24
set AGCM_JM = `expr $AGCM_IM \* 6`
set NX = 4
set NY = `expr $NX \* 6`
set HYDROSTATIC = TRUE
set HIST_IM = `expr $AGCM_IM \* 4`
set HIST_JM = `expr $AGCM_IM \* 2 + 1`
set GRID_FILE = "Gnomonic_c${AGCM_IM}.dat"
set JOB_SGMT = 00000015
set NUM_SGMT = 20
set ATMOStag = CF0024x6C
set POST_NDS = 4
endif
if( $AGCM_IM == "144" ) then
set DT = 900
set SOLAR_DT = 3600
set IRRAD_DT = 3600
set CHEM_DT = $DT
set JOB_SGMT = 00000015
set NUM_SGMT = 20
if( $OGCM == TRUE ) then
set NX = $OGCM_NX
set NY = $OGCM_NY
set OCEAN_DT = $DT
else
set NX = 4
set NY = 12
set OCEAN_DT = $IRRAD_DT
endif
set ATMOStag = DC0144xPC0091
set POST_NDS = 4
endif
if( $AGCM_IM == "c48" ) then
set DT = 900
set SOLAR_DT = 3600
set IRRAD_DT = 3600
set OCEAN_DT = $IRRAD_DT
set CHEM_DT = $DT
set AGCM_IM = 48
set AGCM_JM = `expr $AGCM_IM \* 6`
set NX = 4
set NY = `expr $NX \* 6`
set HYDROSTATIC = TRUE
set HIST_IM = 180
set HIST_JM = 91
set GRID_FILE = "Gnomonic_c${AGCM_IM}.dat"
set JOB_SGMT = 00000015
set NUM_SGMT = 20
set ATMOStag = CF0048x6C
set POST_NDS = 4
endif
if( $AGCM_IM == "288" ) then
set DT = 900
set SOLAR_DT = 3600
set IRRAD_DT = 3600
set CHEM_DT = $DT
set JOB_SGMT = 00000008
set NUM_SGMT = 5
if( $OGCM == TRUE ) then
set NX = $OGCM_NX
set NY = $OGCM_NY
set OCEAN_DT = $DT
else
set NX = 8
set NY = 12
set OCEAN_DT = $IRRAD_DT
endif
set ATMOStag = DC0288xPC0181
set POST_NDS = 8
endif
if( $AGCM_IM == "c90" ) then
set DT = 900
set SOLAR_DT = 3600
set IRRAD_DT = 3600
if ( $OGCM == TRUE ) then
set OCEAN_DT = $DT
else
set OCEAN_DT = $IRRAD_DT
endif
set CHEM_DT = $DT
set AGCM_IM = 90
set AGCM_JM = `expr $AGCM_IM \* 6`
set NX = 12
set NY = `expr $NX \* 5`
set HYDROSTATIC = TRUE
set HIST_IM = `expr $AGCM_IM \* 4`
set HIST_JM = `expr $AGCM_IM \* 2 + 1`
set GRID_FILE = "Gnomonic_c${AGCM_IM}.dat"
set JOB_SGMT = ${fcstsegm}
set NUM_SGMT = 1
set ATMOStag = CF0090x6C
set POST_NDS = 8
endif
if( $AGCM_IM == "576" ) then
set DT = 450
set SOLAR_DT = 3600
set IRRAD_DT = 3600
set CHEM_DT = $DT
set JOB_SGMT = 00000016
set NUM_SGMT = 1
if( $OGCM == TRUE ) then
set NX = $OGCM_NX
set NY = $OGCM_NY
set OCEAN_DT = $DT
else
set NX = 12
set NY = 32
set OCEAN_DT = $IRRAD_DT
endif
set ATMOStag = DC0576xPC0361
set POST_NDS = 8
endif
if( $AGCM_IM == "c180" ) then
set DT = 450
set SOLAR_DT = 3600
set IRRAD_DT = 3600
if ( $OGCM == TRUE ) then
set OCEAN_DT = $DT
else
set OCEAN_DT = $IRRAD_DT
endif
set CHEM_DT = $DT
set AGCM_IM = 180
set AGCM_JM = `expr $AGCM_IM \* 6`
set NX = 12
set NY = 30
set HYDROSTATIC = TRUE
set HIST_IM = `expr $AGCM_IM \* 4`
set HIST_JM = `expr $AGCM_IM \* 2 + 1`
set GRID_FILE = "Gnomonic_c${AGCM_IM}.dat"
set NUM_READERS = 2
set JOB_SGMT = ${fcstsegm}
set NUM_SGMT = 1
set ATMOStag = CF0180x6C
set POST_NDS = 8
endif
if( $AGCM_IM == "1152" ) then
set DT = 450
set SOLAR_DT = 3600
set IRRAD_DT = 3600
set CHEM_DT = $DT
set JOB_SGMT = 00000005
set NUM_SGMT = 1
set NUM_READERS = 4
if( $OGCM == TRUE ) then
set NX = $OGCM_NX
set NY = $OGCM_NY
set OCEAN_DT = $DT
else
set NX = 24
set NY = 32
set OCEAN_DT = $IRRAD_DT
endif
set ATMOStag = DC1152xPC0721
set POST_NDS = 12
endif
if( $AGCM_IM == "c360" ) then
set DT = 450
set SOLAR_DT = 1800
set IRRAD_DT = 1800
set OCEAN_DT = $IRRAD_DT
set CHEM_DT = $DT
set AGCM_IM = 360
set AGCM_JM = `expr $AGCM_IM \* 6`
set NX = 12
set NY = `expr $NX \* 6`
set HYDROSTATIC = TRUE
set HIST_IM = `expr $AGCM_IM \* 4`
set HIST_JM = `expr $AGCM_IM \* 2 + 1`
set GRID_FILE = "Gnomonic_c${AGCM_IM}.dat"
set NUM_READERS = 4
set JOB_SGMT = 00000005
set NUM_SGMT = 1
set ATMOStag = CF0360x6C
set POST_NDS = 12
endif
if( $AGCM_IM == "c500" ) then
set DT = 450
set SOLAR_DT = 1800
set IRRAD_DT = 1800
set OCEAN_DT = $IRRAD_DT
set CHEM_DT = $DT
set AGCM_IM = 500
set AGCM_JM = `expr $AGCM_IM \* 6`
set NX = 12
set NY = `expr $NX \* 6`
set HYDROSTATIC = TRUE
set HIST_IM = `expr $AGCM_IM \* 4`
set HIST_JM = `expr $AGCM_IM \* 2 + 1`
set GRID_FILE = "Gnomonic_c${AGCM_IM}.dat"
set NUM_READERS = 4
set JOB_SGMT = 00000005
set NUM_SGMT = 1
set ATMOStag = CF0500x6C
set POST_NDS = 12
set USE_SHMEM = 1
endif
if( $AGCM_IM == "c720" ) then
set DT = 450
set SOLAR_DT = 1800
set IRRAD_DT = 1800
set OCEAN_DT = $IRRAD_DT
set CHEM_DT = $DT
set AGCM_IM = 720
set AGCM_JM = `expr $AGCM_IM \* 6`
set NX = 16
set NY = `expr $NX \* 6`
set HYDROSTATIC = TRUE
set HIST_IM = `expr $AGCM_IM \* 4`
set HIST_JM = `expr $AGCM_IM \* 2 + 1`
set GRID_FILE = "Gnomonic_c${AGCM_IM}.dat"
set NUM_READERS = 6
set JOB_SGMT = 00000005
set NUM_SGMT = 1
set ATMOStag = CF0720x6C
set POST_NDS = 16
set USE_SHMEM = 1
endif
if( $AGCM_IM == "c1440" ) then
set DT = 450
set SOLAR_DT = 1800
set IRRAD_DT = 1800
set OCEAN_DT = $IRRAD_DT
set CHEM_DT = $DT
set AGCM_IM = 1440
set AGCM_JM = `expr $AGCM_IM \* 6`
set NX = 30
set NY = `expr $NX \* 6`
set HYDROSTATIC = FALSE
set HIST_IM = `expr $AGCM_IM \* 4`
set HIST_JM = `expr $AGCM_IM \* 2 + 1`
set GRID_FILE = "Gnomonic_c${AGCM_IM}.dat"
set NUM_READERS = 6
set JOB_SGMT = 00000001
set NUM_SGMT = 1
set ATMOStag = CF1440x6C
set POST_NDS = 32
set USE_SHMEM = 1
endif
set IS_FCST = 0
if($CUBED == "TRUE") then
set FVCUBED = ""
set FVLATLON = "#DELETE"
set AGCM_GRIDNAME = "PE${AGCM_IM}x${AGCM_JM}-CF"
set OGCM_GRIDNAME = "PE${OGCM_IM}x${OGCM_JM}-${OGRIDTYP}"
set BCSRES = "${ATMOStag}_${OCEANtag}"
set RES_DATELINE = '${AGCM_IM}x${AGCM_JM}'
set TILEDATA = "${ATMOStag}_${OCEANtag}_Pfafstetter.til"
set TILEBIN = "${ATMOStag}_${OCEANtag}_Pfafstetter.TIL"
if( $HIST_IM >= $OGCM_IM ) then
set INTERPOLATE_SST = 1
else
set INTERPOLATE_SST = 0
endif
else
set FVLATLON = ""
set FVCUBED = "#DELETE"
set AGCM_GRIDNAME = "PC${AGCM_IM}x${AGCM_JM}-DC"
set OGCM_GRIDNAME = "PE${OGCM_IM}x${OGCM_JM}-${OGRIDTYP}"
set BCSRES = "${ATMOStag}_${OCEANtag}"
set RES_DATELINE = '${AGCM_IM}x${AGCM_JM}_${DATELINE}'
set TILEDATA = "${ATMOStag}_${OCEANtag}_Pfafstetter.til"
set TILEBIN = "${ATMOStag}_${OCEANtag}_Pfafstetter.TIL"
set HIST_IM = "$AGCM_IM"
set HIST_JM = "$AGCM_JM"
if( $AGCM_IM >= $OGCM_IM ) then
set INTERPOLATE_SST = 1
else
set INTERPOLATE_SST = 0
endif
endif
set BEG_DATE = '18910301 000000'
set END_DATE = "${END_DATE2}"
set JOB_SGMT = "$JOB_SGMT 000000"
#######################################################################
# Check for land surface and runoff routing models #
#######################################################################
# Check for Catche-Carbon
# -----------------------
CATCHCN:
echo "Enter the choice of ${C1} Land Surface Model${CN}: use ${C2}1${CN} (Default: Catchment Model), ${C2}2${CN} (CatchmentCN Model)"
set LSM = 1
if( .$LSM == . ) then
set LSM = 1
endif
if( $LSM != 1 & $LSM != 2 ) then
echo
echo "${C1} Land Surface Model${CN} must be set equal to ${C2}1{CN} or ${C2}2${CN}!"
goto CATCHCN
else
echo
endif
endif
if( $LSM == 1 ) then
set LSM_CHOICE = 1
else
set LSM_CHOICE = 2
endif
echo "QUESTION: ENTERED $LSM => LSM_CHOICE = ${LSM_CHOICE}"
echo
# Check for Runoff Routing Model
# ------------------------------
RRM:
echo "Do you wish to run ${C1} the Runoff Routing Model${CN}? (Default: ${C2}NO${CN} or ${C2}FALSE${CN})"
set RUNRRM = 'YES'
if( .$RUNRRM == . ) then
set RUNRRM = FALSE
else
set RUNRRM = `echo $RUNRRM | tr "[:lower:]" "[:upper:]"`
if( $RUNRRM == "Y" | \
$RUNRRM == "YES" | \
$RUNRRM == "T" | \
$RUNRRM == "TRUE" ) set RUNRRM = TRUE
if( $RUNRRM == "N" | \
$RUNRRM == "NO" | \
$RUNRRM == "F" | \
$RUNRRM == "FALSE" ) set RUNRRM = FALSE
if( $RUNRRM != TRUE & $RUNRRM != FALSE ) then
echo
echo "${C1} the Runoff Routing Model${CN} must be set equal to ${C2}TRUE${CN} or ${C2}FALSE${CN}!"
goto RRM
else
echo
endif
endif
if( $RUNRRM == TRUE ) then
set RUN_ROUTE = 1
else
set RUN_ROUTE = 0
endif
#######################################################################
# Check for AEROSOL/Chemistry Models
#######################################################################
# Check for GOCART
# ----------------
GOCART:
echo "Do you wish to run ${C1}GOCART${CN} with ${C2}Actual${CN} or ${C2}Climatological${CN} Aerosols? (Enter: ${C2}A${CN} (Default) or ${C2}C${CN})"
set GOKART = 'A'
if( .$GOKART == . ) set GOKART = A
set GOKART = `echo $GOKART | tr "[:lower:]" "[:upper:]"`
if( $GOKART != 'A' & $GOKART != 'C' ) then
echo
echo "${C1}GOCART${CN} must be set equal to ${C2}A${CN} or ${C2}C${CN}!"
goto GOCART
else
echo
endif
if( $GOKART == "A" ) set GOKART = TRUE # Use Actual Aerosols
if( $GOKART == "C" ) set GOKART = FALSE # Use Climatological Aerosols
if( $GOKART == TRUE ) then
set GOCART = ""
set GOCART_INTERNAL = "GOCART_INTERNAL"
set HIST_GOCART = ""
# Emission Files
# --------------
EMISSIONS:
set EMISSIONS = ''
echo "Enter the GOCART ${C1}Emission Files${CN} to use: ${C2}MERRA2${CN} (Default), ${C2}PIESA${CN}, ${C2}CMIP${CN}, ${C2}NR${CN}, ${C2}MERRA2-DD${CN} or ${C2}OPS${CN}:"
set EMISSIONS = 'MERRA2'