/[MITgcm]/MITgcm/pkg/exf/exf_check.F
ViewVC logotype

Annotation of /MITgcm/pkg/exf/exf_check.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.14 - (hide annotations) (download)
Thu Jun 17 21:45:16 2010 UTC (14 years ago) by gforget
Branch: MAIN
CVS Tags: checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint63, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x
Changes since 1.13: +26 -14 lines
improve error message handling

1 gforget 1.14 C $Header: /u/gcmpack/MITgcm/pkg/exf/exf_check.F,v 1.13 2010/04/15 00:47:00 gforget Exp $
2 jmc 1.4 C $Name: $
3 heimbach 1.1
4     #include "EXF_OPTIONS.h"
5    
6     subroutine exf_check( mythid )
7    
8     c ==================================================================
9     c SUBROUTINE exf_check
10     c ==================================================================
11     c
12     implicit none
13    
14     c == global variables ==
15    
16     #include "EEPARAMS.h"
17     #include "SIZE.h"
18     #include "PARAMS.h"
19 jmc 1.6 c#include "FFIELDS.h"
20     c#include "GRID.h"
21 heimbach 1.1
22 jmc 1.4 #include "EXF_PARAM.h"
23     #include "EXF_CONSTANTS.h"
24 jmc 1.6 c#include "EXF_FIELDS.h"
25 heimbach 1.1 c == routine arguments ==
26    
27     c mythid - thread number for this instance of the routine.
28    
29     integer mythid
30    
31     c == local variables ==
32    
33 gforget 1.14 C msgBuf :: Informational/error message buffer
34     CHARACTER*(MAX_LEN_MBUF) msgBuf
35    
36 heimbach 1.1 c == end of interface ==
37    
38     c check for consistency
39 jmc 1.12 if (.NOT.
40     & (exf_iprec.EQ.precFloat32 .OR. exf_iprec.EQ.precFloat64)
41 heimbach 1.1 & ) then
42 dimitri 1.8 stop 'S/R EXF_CHECK: value of exf_iprec not allowed'
43 jmc 1.12 elseif ( exf_yftype.NE.'RL' ) then
44 dimitri 1.8 stop 'S/R EXF_CHECK: value of exf_yftype not allowed'
45     endif
46    
47     if (repeatPeriod.lt.0.) then
48     stop 'S/R EXF_CHECK: repeatPeriod must be positive'
49     endif
50 heimbach 1.1
51 dimitri 1.8 if (useExfYearlyFields.and.repeatPeriod.ne.0.) then
52     print*,'Use of usefldyearlyfields AND repeatPeriod',
53     & ' not implemented'
54     stop 'ABNORMAL END: S/R EXF_CHECK'
55 heimbach 1.1 endif
56    
57 jmc 1.6 #if ( defined (ALLOW_BULKFORMULAE) && defined (ALLOW_ATM_WIND) )
58 gforget 1.11 IF ( ustressfile .NE. ' ' .OR. ustressfile .NE. ' ' ) THEN
59 jmc 1.6 STOP
60     & 'S/R EXF_CHECK: use u,v_wind components but not wind-stress'
61     ENDIF
62     #endif
63 dimitri 1.8
64 jmc 1.6 #ifndef ALLOW_ATM_WIND
65     IF ( uwindfile .NE. ' ' .OR. vwindfile .NE. ' ' ) THEN
66     STOP
67     & 'S/R EXF_CHECK: read-in wind-stress but not u,v_wind components'
68     ENDIF
69     #endif
70    
71 gforget 1.13 #ifndef ALLOW_ZENITHANGLE
72     IF ( useExfZenAlbedo .OR. useExfZenIncoming .OR.
73     & select_ZenAlbedo .NE. 0 ) THEN
74 gforget 1.14 WRITE(msgBuf,'(A,A)') 'S/R EXF_CHECK: unsupported option',
75     & ' when ALLOW_ZENITHANGLE is not defined'
76     CALL PRINT_ERROR( msgBuf , mythid)
77     STOP 'ABNORMAL END: S/R EXF_CHECK'
78 gforget 1.13 ENDIF
79     #endif
80    
81     #ifdef ALLOW_ZENITHANGLE
82     IF ( usingCartesianGrid .OR. usingCylindricalGrid ) then
83 gforget 1.14 WRITE(msgBuf,'(A,A)') 'S/R EXF_CHECK: ALLOW_ZENITHANGLE does ',
84     & 'not work for carthesian and cylindrical grids'
85     CALL PRINT_ERROR( msgBuf , mythid)
86     STOP 'ABNORMAL END: S/R EXF_CHECK'
87 gforget 1.13 ENDIF
88     IF ( select_ZenAlbedo.LT.0 .OR. select_ZenAlbedo.GT.3 ) then
89 gforget 1.14 WRITE(msgBuf,'(A,A)') 'S/R EXF_CHECK: unsupported ',
90     & 'select_ZenAlbedo choice'
91     CALL PRINT_ERROR( msgBuf , mythid)
92     STOP 'ABNORMAL END: S/R EXF_CHECK'
93 gforget 1.13 ENDIF
94     IF ( select_ZenAlbedo.EQ.2 .) then
95 gforget 1.14 write(standardmessageunit,'(A,A)')
96     & 'EXF WARNING: for daily mean albedo, it is advised ',
97     & 'to use select_ZenAlbedo.EQ.1 instead of 2'
98 gforget 1.13 ENDIF
99     IF ( select_ZenAlbedo.GT.2 .AND. swdownperiod.GT. 21600 ) then
100 gforget 1.14 WRITE(msgBuf,'(A,A)') 'S/R EXF_CHECK: using diurnal albedo ',
101     & 'formula requires diurnal downward shortwave forcing'
102     CALL PRINT_ERROR( msgBuf , mythid)
103     STOP 'ABNORMAL END: S/R EXF_CHECK'
104 gforget 1.13 ENDIF
105     IF ( select_ZenAlbedo.GT.2 .AND. swdownperiod.GT. 3600 ) then
106 gforget 1.14 write(standardmessageunit,'(A,A)')
107     & 'EXF WARNING: the diurnal albedo formula is likely not safe ',
108     & 'for such coarse temporal resolution downward shortwave forcing'
109 gforget 1.13 ENDIF
110     #endif
111    
112    
113 dimitri 1.3 #ifdef USE_EXF_INTERPOLATION
114 jmc 1.6 if ( climsst_nlat .GT. MAX_LAT_INC )
115     & stop 'stopped in exf_readparms: climsst_nlat > MAX_LAT_INC'
116     if ( climsss_nlat .GT. MAX_LAT_INC )
117     & stop 'stopped in exf_readparms: climsss_nlat > MAX_LAT_INC'
118 dimitri 1.3 if ( usingCartesianGrid ) then
119     print*,'USE_EXF_INTERPOLATION assumes latitude/longitude'
120     print*,'input and output coordinates. Trivial to extend to'
121     print*,'cartesian coordinates, but has not yet been done.'
122     stop
123     endif
124 jmc 1.6 IF ( readStressOnAgrid.OR.readStressOnCgrid ) THEN
125     STOP 'wind-stress position defined by Long/Lat'
126     ENDIF
127 dimitri 1.8 if ( usingCurvilinearGrid ) then
128     c some restrictions that can be relaxed later on
129 dimitri 1.9 if ( ustressfile .NE. ' ' .and. vstressfile .NE. ' ' ) then
130     if ( ustressstartdate .ne. vstressstartdate .or.
131     & ustressperiod .ne. vstressperiod ) then
132 dimitri 1.8 print*,'For useCubedSphereExchange, S/R exf_set_uv.F'
133 dimitri 1.9 print*,'assumes that the u and v wind stress files'
134     print*,'have the same startdate and period.'
135     stop
136     endif
137     endif
138     if ( uwindfile .NE. ' ' .and. vwindfile .NE. ' ' ) then
139     if ( uwindstartdate .ne. vwindstartdate .or.
140     & uwindperiod .ne. vwindperiod ) then
141     print*,'For useCubedSphereExchange, S/R exf_set_uv.F'
142     print*,'assumes that the u and v wind files'
143     print*,'have the same startdate and period.'
144 dimitri 1.8 stop
145     endif
146     endif
147     endif
148     #else /* ifndef USE_EXF_INTERPOLATION */
149 heimbach 1.7 IF ( ustressfile .NE. ' ' .OR. vstressfile .NE. ' ' ) THEN
150 jmc 1.6 IF ( (readStressOnAgrid.AND.readStressOnCgrid) .OR.
151     & .NOT.(readStressOnAgrid.OR.readStressOnCgrid) ) THEN
152     STOP
153     & 'S/R EXF_CHECK: Select 1 wind-stress position: A or C-grid'
154     ENDIF
155     ELSE
156     IF ( readStressOnAgrid .OR. readStressOnCgrid ) THEN
157     STOP 'S/R EXF_CHECK: wind-stress position irrelevant'
158     ENDIF
159     ENDIF
160 dimitri 1.8 #endif /* USE_EXF_INTERPOLATION */
161 dimitri 1.3
162 heimbach 1.2 #ifdef ALLOW_CLIMTEMP_RELAXATION
163     STOP 'ALLOW_CLIMTEMP_RELAXATION no longer supported. Use pkg/rbcs'
164     #endif
165 heimbach 1.1
166 heimbach 1.2 #ifdef ALLOW_CLIMSALT_RELAXATION
167     STOP 'ALLOW_CLIMSALT_RELAXATION no longer supported. Use pkg/rbcs'
168     #endif
169    
170 jmc 1.6 RETURN
171     END

  ViewVC Help
Powered by ViewVC 1.1.22