File indexing completed on 2018-03-02 18:36:49 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
11033c8df1 Jean*0001 #include "PACKAGES_CONFIG.h"
1dbaea09ee Chri*0002 #include "CPP_OPTIONS.h"
924557e60a Chri*0003
9366854e02 Chri*0004
0005
b6356366ca Ed H*0006
9366854e02 Chri*0007
924557e60a Chri*0008 SUBROUTINE INI_GRID( myThid )
b6356366ca Ed H*0009
0010
0011
0012
0013
924557e60a Chri*0014
d87b427b2d Jean*0015
0016
0017
0018
0019
0020
0021
0022
0023
9366854e02 Chri*0024
0025 IMPLICIT NONE
924557e60a Chri*0026 #include "SIZE.h"
0027 #include "EEPARAMS.h"
0028 #include "PARAMS.h"
a9e63588d9 Jean*0029 #include "GRID.h"
f31930e56f Ed H*0030 #ifdef ALLOW_MNC
0031 #include "MNC_PARAMS.h"
0032 #endif
b6356366ca Ed H*0033 #ifdef ALLOW_MONITOR
0034 #include "MONITOR.h"
0035 #endif
924557e60a Chri*0036
9366854e02 Chri*0037
b9306711eb Jean*0038
924557e60a Chri*0039 INTEGER myThid
0040
67eed25d83 Jean*0041
49aab2cab9 Jean*0042 LOGICAL MASTER_CPU_IO
0043 EXTERNAL MASTER_CPU_IO
0044
9366854e02 Chri*0045
67eed25d83 Jean*0046
0047
b9306711eb Jean*0048
67eed25d83 Jean*0049 INTEGER bi, bj
0050 INTEGER i, j
924557e60a Chri*0051 CHARACTER*(MAX_LEN_MBUF) msgBuf
67eed25d83 Jean*0052
0053
0054
924557e60a Chri*0055
71b5d4795f Jean*0056
f76021331f Jean*0057 CALL LOAD_GRID_SPACING( myThid )
0058
71b5d4795f Jean*0059
a74b31ee34 Alis*0060 CALL INI_VERTICAL_GRID( myThid )
0061
71b5d4795f Jean*0062
0063
0064
0065
0066 DO bj = myByLo(myThid), myByHi(myThid)
0067 DO bi = myBxLo(myThid), myBxHi(myThid)
0068 DO j=1-OLy,sNy+OLy
0069 DO i=1-OLx,sNx+OLx
0070 xC(i,j,bi,bj) = 0.
0071 yC(i,j,bi,bj) = 0.
0072 xG(i,j,bi,bj) = 0.
0073 yG(i,j,bi,bj) = 0.
0074 dxC(i,j,bi,bj) = 0.
0075 dyC(i,j,bi,bj) = 0.
0076 dxG(i,j,bi,bj) = 0.
0077 dyG(i,j,bi,bj) = 0.
0078 dxF(i,j,bi,bj) = 0.
0079 dyF(i,j,bi,bj) = 0.
0080 dxV(i,j,bi,bj) = 0.
0081 dyU(i,j,bi,bj) = 0.
0082 rA(i,j,bi,bj) = 0.
0083 rAz(i,j,bi,bj) = 0.
0084 rAw(i,j,bi,bj) = 0.
0085 rAs(i,j,bi,bj) = 0.
0086 recip_dxG(i,j,bi,bj) = 0.
0087 recip_dyG(i,j,bi,bj) = 0.
0088 recip_dxC(i,j,bi,bj) = 0.
0089 recip_dyC(i,j,bi,bj) = 0.
0090 recip_dxF(i,j,bi,bj) = 0.
0091 recip_dyF(i,j,bi,bj) = 0.
0092 recip_dxV(i,j,bi,bj) = 0.
0093 recip_dyU(i,j,bi,bj) = 0.
0094 recip_rA (i,j,bi,bj) = 0.
0095 recip_rAs(i,j,bi,bj) = 0.
0096 recip_rAw(i,j,bi,bj) = 0.
0097 recip_rAz(i,j,bi,bj) = 0.
0098 tanPhiAtU(i,j,bi,bj) = 0.
0099 tanPhiAtV(i,j,bi,bj) = 0.
0100 angleCosC(i,j,bi,bj) = 1.
0101 angleSinC(i,j,bi,bj) = 0.
0102 u2zonDir(i,j,bi,bj) = 1.
0103 v2zonDir(i,j,bi,bj) = 0.
0104 ENDDO
0105 cosFacU(j,bi,bj) = 1.
0106 cosFacV(j,bi,bj) = 1.
0107 sqCosFacU(j,bi,bj) = 1.
0108 sqCosFacV(j,bi,bj) = 1.
0109 ENDDO
0110 ENDDO
0111 ENDDO
0112
b6356366ca Ed H*0113
0114
0115
0116
0117
0118
0119
b9306711eb Jean*0120
0121
0122
0123
0124
0125
0126
0127
b6356366ca Ed H*0128
71b5d4795f Jean*0129
924557e60a Chri*0130 IF ( usingCartesianGrid ) THEN
b6356366ca Ed H*0131 CALL INI_CARTESIAN_GRID( myThid )
924557e60a Chri*0132 ELSEIF ( usingSphericalPolarGrid ) THEN
b6356366ca Ed H*0133 CALL INI_SPHERICAL_POLAR_GRID( myThid )
aea29c8517 Alis*0134 ELSEIF ( usingCurvilinearGrid ) THEN
b6356366ca Ed H*0135 CALL INI_CURVILINEAR_GRID( myThid )
0ac260a803 Andr*0136 ELSEIF ( usingCylindricalGrid ) THEN
b6aef9f254 Jean*0137 CALL INI_CYLINDER_GRID( myThid )
924557e60a Chri*0138 ELSE
b6356366ca Ed H*0139 _BEGIN_MASTER(myThid)
0140 WRITE(msgBuf,'(2A)') 'S/R INI_GRID: ',
0141 & 'No grid coordinate system has been selected'
0142 CALL PRINT_ERROR( msgBuf , myThid)
67eed25d83 Jean*0143 CALL ALL_PROC_DIE( 0 )
b6356366ca Ed H*0144 STOP 'ABNORMAL END: S/R INI_GRID'
0145 _END_MASTER(myThid)
924557e60a Chri*0146 ENDIF
aea29c8517 Alis*0147
71b5d4795f Jean*0148
67eed25d83 Jean*0149 DO bj = myByLo(myThid), myByHi(myThid)
0150 DO bi = myBxLo(myThid), myBxHi(myThid)
0151 DO j=1-OLy,sNy+OLy
0152 DO i=1-OLx,sNx+OLx
0153 IF ( dxG(i,j,bi,bj) .NE. 0. )
0154 & recip_dxG(i,j,bi,bj) = 1. _d 0/dxG(i,j,bi,bj)
0155 IF ( dyG(i,j,bi,bj) .NE. 0. )
0156 & recip_dyG(i,j,bi,bj) = 1. _d 0/dyG(i,j,bi,bj)
0157 IF ( dxC(i,j,bi,bj) .NE. 0. )
0158 & recip_dxC(i,j,bi,bj) = 1. _d 0/dxC(i,j,bi,bj)
0159 IF ( dyC(i,j,bi,bj) .NE. 0. )
0160 & recip_dyC(i,j,bi,bj) = 1. _d 0/dyC(i,j,bi,bj)
0161 IF ( dxF(i,j,bi,bj) .NE. 0. )
0162 & recip_dxF(i,j,bi,bj) = 1. _d 0/dxF(i,j,bi,bj)
0163 IF ( dyF(i,j,bi,bj) .NE. 0. )
0164 & recip_dyF(i,j,bi,bj) = 1. _d 0/dyF(i,j,bi,bj)
0165 IF ( dxV(i,j,bi,bj) .NE. 0. )
0166 & recip_dxV(i,j,bi,bj) = 1. _d 0/dxV(i,j,bi,bj)
0167 IF ( dyU(i,j,bi,bj) .NE. 0. )
0168 & recip_dyU(i,j,bi,bj) = 1. _d 0/dyU(i,j,bi,bj)
0169 IF ( rA (i,j,bi,bj) .NE. 0. )
0170 & recip_rA (i,j,bi,bj) = 1. _d 0/rA (i,j,bi,bj)
0171 IF ( rAs(i,j,bi,bj) .NE. 0. )
0172 & recip_rAs(i,j,bi,bj) = 1. _d 0/rAs(i,j,bi,bj)
0173 IF ( rAw(i,j,bi,bj) .NE. 0. )
0174 & recip_rAw(i,j,bi,bj) = 1. _d 0/rAw(i,j,bi,bj)
0175 IF ( rAz(i,j,bi,bj) .NE. 0. )
0176 & recip_rAz(i,j,bi,bj) = 1. _d 0/rAz(i,j,bi,bj)
0177 ENDDO
0178 ENDDO
0179 ENDDO
0180 ENDDO
0181
0182
0183
a3159bd164 Patr*0184 #ifdef ALLOW_MONITOR
49aab2cab9 Jean*0185 IF ( MASTER_CPU_IO(myThid) ) THEN
a9e63588d9 Jean*0186
ff02675122 Jean*0187
a9e63588d9 Jean*0188
0189 IF (monitor_stdio) THEN
0190 mon_write_stdout = .TRUE.
0191 ELSE
0192 mon_write_stdout = .FALSE.
0193 ENDIF
0194 mon_write_mnc = .FALSE.
b6356366ca Ed H*0195 #ifdef ALLOW_MNC
a9e63588d9 Jean*0196 IF (useMNC .AND. monitor_mnc) THEN
0197 DO i = 1,MAX_LEN_MBUF
0198 mon_fname(i:i) = ' '
0199 ENDDO
0200 mon_fname(1:12) = 'monitor_grid'
0201 CALL MNC_CW_SET_UDIM(mon_fname, 1, myThid)
0202 mon_write_mnc = .TRUE.
0203 ENDIF
b6356366ca Ed H*0204 #endif /* ALLOW_MNC */
a9e63588d9 Jean*0205
0206 ENDIF
0207
67eed25d83 Jean*0208
a9e63588d9 Jean*0209 CALL MON_PRINTSTATS_RS(1,xC,'XC',myThid)
0210 CALL MON_PRINTSTATS_RS(1,xG,'XG',myThid)
0211 CALL MON_PRINTSTATS_RS(1,dxC,'DXC',myThid)
0212 CALL MON_PRINTSTATS_RS(1,dxF,'DXF',myThid)
0213 CALL MON_PRINTSTATS_RS(1,dxG,'DXG',myThid)
0214 CALL MON_PRINTSTATS_RS(1,dxV,'DXV',myThid)
0215 CALL MON_PRINTSTATS_RS(1,yC,'YC',myThid)
0216 CALL MON_PRINTSTATS_RS(1,yG,'YG',myThid)
0217 CALL MON_PRINTSTATS_RS(1,dyC,'DYC',myThid)
0218 CALL MON_PRINTSTATS_RS(1,dyF,'DYF',myThid)
0219 CALL MON_PRINTSTATS_RS(1,dyG,'DYG',myThid)
0220 CALL MON_PRINTSTATS_RS(1,dyU,'DYU',myThid)
0221 CALL MON_PRINTSTATS_RS(1,rA,'RA',myThid)
0222 CALL MON_PRINTSTATS_RS(1,rAw,'RAW',myThid)
0223 CALL MON_PRINTSTATS_RS(1,rAs,'RAS',myThid)
0224 CALL MON_PRINTSTATS_RS(1,rAz,'RAZ',myThid)
b6aef9f254 Jean*0225 CALL MON_PRINTSTATS_RS(1,angleCosC,'AngleCS',myThid)
0226 CALL MON_PRINTSTATS_RS(1,angleSinC,'AngleSN',myThid)
b6356366ca Ed H*0227
49aab2cab9 Jean*0228 IF ( MASTER_CPU_IO(myThid) ) THEN
a9e63588d9 Jean*0229 mon_write_stdout = .FALSE.
0230 mon_write_mnc = .FALSE.
0231 ENDIF
0232 #endif /* ALLOW_MONITOR */
49aab2cab9 Jean*0233
0234
0235 _BARRIER
398b491097 Alis*0236
924557e60a Chri*0237 RETURN
0238 END