1 |
molod |
1.11 |
C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_alarms.F,v 1.10 2004/09/13 20:24:10 molod Exp $ |
2 |
molod |
1.2 |
C $Name: $ |
3 |
|
|
|
4 |
molod |
1.6 |
#include "FIZHI_OPTIONS.h" |
5 |
molod |
1.8 |
subroutine fizhi_alarms (nymdb,nhmsb,deltaT) |
6 |
molod |
1.1 |
|
7 |
|
|
C*********************************************************************** |
8 |
|
|
C Purpose |
9 |
|
|
C ------- |
10 |
|
|
C Driver to Set Internal Model Alarms |
11 |
|
|
C |
12 |
|
|
C Argument Description |
13 |
|
|
C -------------------- |
14 |
|
|
C nymdb ..... Begining Date to Start Alarm Clock |
15 |
|
|
C nhmsb ..... Begining Time to Start Alarm Clock |
16 |
|
|
C ndt ....... Model Timestep |
17 |
|
|
C |
18 |
|
|
C Note: For ndt = 0, all Intermal Model Alarms are set to 1 second |
19 |
|
|
C |
20 |
|
|
C*********************************************************************** |
21 |
|
|
implicit none |
22 |
|
|
|
23 |
|
|
c Input Parameters |
24 |
|
|
c ---------------- |
25 |
molod |
1.8 |
integer nymdb,nhmsb |
26 |
|
|
_RL deltaT |
27 |
molod |
1.1 |
|
28 |
|
|
c MPI Utilities |
29 |
|
|
c ------------- |
30 |
|
|
#ifdef ALLOW_USE_MPI |
31 |
molod |
1.5 |
#include "mpif.h" |
32 |
|
|
integer ierror |
33 |
molod |
1.1 |
#endif |
34 |
molod |
1.5 |
integer myid |
35 |
molod |
1.1 |
|
36 |
|
|
c Physics Frequencies |
37 |
|
|
c ------------------- |
38 |
molod |
1.8 |
integer ndt |
39 |
molod |
1.1 |
integer nhmsf, m,n, nd |
40 |
|
|
integer ndlw, ndsw, ndturb, ndmoist |
41 |
|
|
|
42 |
|
|
#ifdef ALLOW_USE_MPI |
43 |
|
|
call mpi_comm_rank ( mpi_comm_world,myid,ierror ) |
44 |
|
|
#else |
45 |
molod |
1.3 |
myid = 1 |
46 |
molod |
1.1 |
#endif |
47 |
molod |
1.8 |
|
48 |
|
|
ndt = deltaT |
49 |
|
|
|
50 |
molod |
1.1 |
if( ndt.ne.0 ) then |
51 |
|
|
|
52 |
molod |
1.4 |
C Longwave Radiation Frequency |
53 |
|
|
ndlw = 030000 |
54 |
|
|
C Shortwave Radiation Frequency |
55 |
|
|
ndsw = 010000 |
56 |
molod |
1.1 |
|
57 |
|
|
c Turbulence |
58 |
|
|
c ---------- |
59 |
|
|
ndturb = 2*int( max(1.0,(300./iabs(ndt)+0.5)/2) ) * iabs(ndt) |
60 |
|
|
|
61 |
|
|
n = 1 |
62 |
|
|
m = -1 |
63 |
|
|
nd = ndturb |
64 |
|
|
do while ( mod(3*3600,nd).ne.0 ) |
65 |
|
|
nd = ndturb + 2*n*m*ndt |
66 |
|
|
m = -m |
67 |
|
|
n = n+1 |
68 |
|
|
if( nd.lt.ndt ) then |
69 |
molod |
1.3 |
if( myid.eq.1 ) then |
70 |
molod |
1.1 |
print * |
71 |
|
|
print *, 'Turbulence cannot occur with Model Timestep = ',ndt |
72 |
|
|
print * |
73 |
|
|
endif |
74 |
|
|
call my_finalize |
75 |
|
|
call my_exit (101) |
76 |
|
|
endif |
77 |
|
|
enddo |
78 |
|
|
ndturb = nhmsf( nd ) |
79 |
|
|
|
80 |
|
|
c Moist Processes |
81 |
|
|
c --------------- |
82 |
|
|
ndmoist = int( 600./iabs(ndt) + 0.5 ) * iabs(ndt) |
83 |
|
|
|
84 |
|
|
n = 1 |
85 |
|
|
m = -1 |
86 |
|
|
nd = ndmoist |
87 |
|
|
do while ( mod(3*3600,nd).ne.0 ) |
88 |
|
|
nd = ndmoist + n*m*ndt |
89 |
|
|
m = -m |
90 |
|
|
n = n+1 |
91 |
|
|
if( nd.lt.ndt ) then |
92 |
molod |
1.3 |
if( myid.eq.1 ) then |
93 |
molod |
1.1 |
print * |
94 |
|
|
print *, 'Convection cannot occur with Model Timestep = ',ndt |
95 |
|
|
print * |
96 |
|
|
endif |
97 |
|
|
call my_finalize |
98 |
|
|
call my_exit (101) |
99 |
|
|
endif |
100 |
|
|
enddo |
101 |
|
|
ndmoist = nhmsf( nd ) |
102 |
|
|
|
103 |
|
|
else |
104 |
|
|
|
105 |
|
|
c For NDT = 0, all Alarms set to 1 second |
106 |
|
|
c --------------------------------------- |
107 |
molod |
1.4 |
C Longwave Radiation Frequency |
108 |
|
|
ndlw = 000001 |
109 |
|
|
C Shortwave Radiation Frequency |
110 |
|
|
ndsw = 000001 |
111 |
|
|
C Turbulence Frequency |
112 |
|
|
ndturb = 000001 |
113 |
|
|
C Moist Processes Frequency |
114 |
|
|
ndmoist = 000001 |
115 |
molod |
1.1 |
|
116 |
|
|
endif |
117 |
|
|
|
118 |
|
|
c Set Alarm Clocks |
119 |
|
|
c ---------------- |
120 |
molod |
1.9 |
|
121 |
molod |
1.10 |
ndlw = 003000 |
122 |
|
|
ndsw = 003000 |
123 |
|
|
ndmoist = 003000 |
124 |
molod |
1.11 |
ndturb = 001000 |
125 |
molod |
1.9 |
|
126 |
molod |
1.1 |
call set_alarm ( 'radsw',nymdb,nhmsb,ndsw ) |
127 |
|
|
call set_alarm ( 'radlw',nymdb,nhmsb,ndlw ) |
128 |
|
|
call set_alarm ( 'turb' ,nymdb,nhmsb,ndturb ) |
129 |
|
|
call set_alarm ( 'moist',nymdb,nhmsb,ndmoist ) |
130 |
molod |
1.7 |
call set_alarm ( 'pnt',nymdb,nhmsb,0 ) |
131 |
molod |
1.1 |
|
132 |
|
|
return |
133 |
|
|
end |