/[MITgcm]/MITgcm/model/src/ini_grid.F
ViewVC logotype

Annotation of /MITgcm/model/src/ini_grid.F

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


Revision 1.33 - (hide annotations) (download)
Tue Mar 16 00:08:27 2010 UTC (14 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62w, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint63g, checkpoint63, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63a, checkpoint63b, checkpoint63c
Changes since 1.32: +2 -2 lines
avoid unbalanced quote (single or double) in commented line

1 jmc 1.33 C $Header: /u/gcmpack/MITgcm/model/src/ini_grid.F,v 1.32 2008/09/05 20:15:28 jmc Exp $
2 adcroft 1.8 C $Name: $
3 cnh 1.1
4 jmc 1.19 #include "PACKAGES_CONFIG.h"
5 cnh 1.5 #include "CPP_OPTIONS.h"
6 cnh 1.1
7 cnh 1.10 CBOP
8     C !ROUTINE: INI_GRID
9 edhill 1.21
10 cnh 1.10 C !INTERFACE:
11 cnh 1.1 SUBROUTINE INI_GRID( myThid )
12 edhill 1.21 C !DESCRIPTION:
13     C These arrays are used throughout the code in evaluating gradients,
14     C integrals and spatial avarages. This routine is called separately
15     C by each thread and initializes only the region of the domain it is
16     C "responsible" for.
17 cnh 1.10
18 jmc 1.32 C !CALLING SEQUENCE:
19     C INI_GRID
20     C | -- LOAD_GRID_SPACING
21     C | -- INI_VERTICAL_GRID
22     C | / INI_CARTESIAN_GRID
23     C | / INI_SPHERICAL_POLAR_GRID
24     C | \ INI_CURVILINEAR_GRID
25     C | \ INI_CYLINDER_GRID
26    
27 cnh 1.10 C !USES:
28 adcroft 1.6 IMPLICIT NONE
29 cnh 1.1 #include "SIZE.h"
30     #include "EEPARAMS.h"
31     #include "PARAMS.h"
32 jmc 1.28 #include "GRID.h"
33 edhill 1.23 #ifdef ALLOW_MNC
34     #include "MNC_PARAMS.h"
35     #endif
36 edhill 1.21 #ifdef ALLOW_MONITOR
37     #include "MONITOR.h"
38     #endif
39 cnh 1.1
40 cnh 1.10 C !INPUT/OUTPUT PARAMETERS:
41 jmc 1.31 C myThid :: my Thread Id number
42 cnh 1.1 INTEGER myThid
43 edhill 1.21 CEOP
44 cnh 1.1
45 jmc 1.30 C === Functions ====
46     LOGICAL MASTER_CPU_IO
47     EXTERNAL MASTER_CPU_IO
48    
49 cnh 1.10 C !LOCAL VARIABLES:
50 jmc 1.31 C msgBuf :: Informational/error message buffer
51 cnh 1.1 CHARACTER*(MAX_LEN_MBUF) msgBuf
52 jmc 1.26 #ifdef ALLOW_MNC
53 edhill 1.21 INTEGER i
54 jmc 1.26 #endif
55 cnh 1.1
56 jmc 1.25 C load grid spacing (vector) from files
57     CALL LOAD_GRID_SPACING( myThid )
58    
59 edhill 1.21 C Set up vertical grid and coordinate system
60 adcroft 1.4 CALL INI_VERTICAL_GRID( myThid )
61    
62 edhill 1.21 C Two examples are shown in this code. One illustrates the
63     C initialization of a cartesian grid. The other shows the
64     C inialization of a spherical polar grid. Other orthonormal grids
65     C can be fitted into this design. In this case custom metric terms
66     C also need adding to account for the projections of velocity
67     C vectors onto these grids. The structure used here also makes it
68     C possible to implement less regular grid mappings. In particular:
69 jmc 1.31 C o Schemes which leave out blocks of the domain that are
70     C all land could be supported.
71     C o Multi-level schemes such as icosohedral or cubic
72     C grid projectedions onto a sphere can also be fitted
73     C within the strategy we use.
74     C Both of the above also require modifying the support
75     C routines that map computational blocks to simulation
76     C domain blocks.
77 edhill 1.21
78     C Set up horizontal grid and coordinate system
79 cnh 1.1 IF ( usingCartesianGrid ) THEN
80 edhill 1.21 CALL INI_CARTESIAN_GRID( myThid )
81 cnh 1.1 ELSEIF ( usingSphericalPolarGrid ) THEN
82 edhill 1.21 CALL INI_SPHERICAL_POLAR_GRID( myThid )
83 adcroft 1.8 ELSEIF ( usingCurvilinearGrid ) THEN
84 edhill 1.21 CALL INI_CURVILINEAR_GRID( myThid )
85 afe 1.17 ELSEIF ( usingCylindricalGrid ) THEN
86 jmc 1.24 CALL INI_CYLINDER_GRID( myThid )
87 cnh 1.1 ELSE
88 edhill 1.21 _BEGIN_MASTER(myThid)
89     WRITE(msgBuf,'(2A)') 'S/R INI_GRID: ',
90     & 'No grid coordinate system has been selected'
91     CALL PRINT_ERROR( msgBuf , myThid)
92     STOP 'ABNORMAL END: S/R INI_GRID'
93     _END_MASTER(myThid)
94 cnh 1.1 ENDIF
95 dimitri 1.15
96 adcroft 1.20 #ifdef ALLOW_MONITOR
97 jmc 1.30 IF ( MASTER_CPU_IO(myThid) ) THEN
98 jmc 1.28 C-- only the master thread is allowed to switch On/Off mon_write_stdout
99 jmc 1.33 C & mon_write_mnc (since it is the only thread that uses those flags):
100 jmc 1.28
101     IF (monitor_stdio) THEN
102     mon_write_stdout = .TRUE.
103     ELSE
104     mon_write_stdout = .FALSE.
105     ENDIF
106     mon_write_mnc = .FALSE.
107 edhill 1.21 #ifdef ALLOW_MNC
108 jmc 1.28 IF (useMNC .AND. monitor_mnc) THEN
109     DO i = 1,MAX_LEN_MBUF
110     mon_fname(i:i) = ' '
111     ENDDO
112     mon_fname(1:12) = 'monitor_grid'
113     CALL MNC_CW_SET_UDIM(mon_fname, 1, myThid)
114     mon_write_mnc = .TRUE.
115     ENDIF
116     #endif /* ALLOW_MNC */
117    
118 edhill 1.21 ENDIF
119 jmc 1.28
120 edhill 1.21 C Print out statistics of each horizontal grid array (helps when
121     C debugging)
122 jmc 1.28 CALL MON_PRINTSTATS_RS(1,xC,'XC',myThid)
123     CALL MON_PRINTSTATS_RS(1,xG,'XG',myThid)
124     CALL MON_PRINTSTATS_RS(1,dxC,'DXC',myThid)
125     CALL MON_PRINTSTATS_RS(1,dxF,'DXF',myThid)
126     CALL MON_PRINTSTATS_RS(1,dxG,'DXG',myThid)
127     CALL MON_PRINTSTATS_RS(1,dxV,'DXV',myThid)
128     CALL MON_PRINTSTATS_RS(1,yC,'YC',myThid)
129     CALL MON_PRINTSTATS_RS(1,yG,'YG',myThid)
130     CALL MON_PRINTSTATS_RS(1,dyC,'DYC',myThid)
131     CALL MON_PRINTSTATS_RS(1,dyF,'DYF',myThid)
132     CALL MON_PRINTSTATS_RS(1,dyG,'DYG',myThid)
133     CALL MON_PRINTSTATS_RS(1,dyU,'DYU',myThid)
134     CALL MON_PRINTSTATS_RS(1,rA,'RA',myThid)
135     CALL MON_PRINTSTATS_RS(1,rAw,'RAW',myThid)
136     CALL MON_PRINTSTATS_RS(1,rAs,'RAS',myThid)
137     CALL MON_PRINTSTATS_RS(1,rAz,'RAZ',myThid)
138 jmc 1.24 CALL MON_PRINTSTATS_RS(1,angleCosC,'AngleCS',myThid)
139     CALL MON_PRINTSTATS_RS(1,angleSinC,'AngleSN',myThid)
140 edhill 1.21
141 jmc 1.30 IF ( MASTER_CPU_IO(myThid) ) THEN
142 jmc 1.28 mon_write_stdout = .FALSE.
143     mon_write_mnc = .FALSE.
144     ENDIF
145     #endif /* ALLOW_MONITOR */
146 jmc 1.30
147     C-- Everyone else must wait for the grid to be set
148     _BARRIER
149 adcroft 1.8
150 cnh 1.1 RETURN
151     END

  ViewVC Help
Powered by ViewVC 1.1.22