/[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.22 - (hide annotations) (download)
Sun Oct 10 06:08:47 2004 UTC (19 years, 7 months ago) by edhill
Branch: MAIN
Changes since 1.21: +1 -4 lines
 o move useMNC and related runtime switches to PARAMS.h

1 edhill 1.22 C $Header: /u/gcmpack/MITgcm/model/src/ini_grid.F,v 1.21 2004/09/15 21:23:32 edhill 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     C !USES:
19 adcroft 1.6 IMPLICIT NONE
20 cnh 1.1 #include "SIZE.h"
21     #include "EEPARAMS.h"
22     #include "PARAMS.h"
23     #include "GRID.h"
24 edhill 1.21 #ifdef ALLOW_MONITOR
25     #include "MONITOR.h"
26     #endif
27 cnh 1.1
28 cnh 1.10 C !INPUT/OUTPUT PARAMETERS:
29 cnh 1.1 INTEGER myThid
30 edhill 1.21 CEOP
31 cnh 1.1
32 cnh 1.10 C !LOCAL VARIABLES:
33 cnh 1.1 C msgBuf - Used for informational I/O.
34     CHARACTER*(MAX_LEN_MBUF) msgBuf
35 edhill 1.21 INTEGER i
36 cnh 1.1
37 edhill 1.21 C Set up vertical grid and coordinate system
38 adcroft 1.4 CALL INI_VERTICAL_GRID( myThid )
39    
40 edhill 1.21 C Two examples are shown in this code. One illustrates the
41     C initialization of a cartesian grid. The other shows the
42     C inialization of a spherical polar grid. Other orthonormal grids
43     C can be fitted into this design. In this case custom metric terms
44     C also need adding to account for the projections of velocity
45     C vectors onto these grids. The structure used here also makes it
46     C possible to implement less regular grid mappings. In particular:
47     C o Schemes which leave out blocks of the domain that are
48     C all land could be supported.
49     C o Multi-level schemes such as icosohedral or cubic
50     C grid projectedions onto a sphere can also be fitted
51     C within the strategy we use.
52     C Both of the above also require modifying the support
53     C routines that map computational blocks to simulation
54     C domain blocks.
55    
56     C Set up horizontal grid and coordinate system
57 cnh 1.1 IF ( usingCartesianGrid ) THEN
58 edhill 1.21 CALL INI_CARTESIAN_GRID( myThid )
59 cnh 1.1 ELSEIF ( usingSphericalPolarGrid ) THEN
60 edhill 1.21 CALL INI_SPHERICAL_POLAR_GRID( myThid )
61 adcroft 1.8 ELSEIF ( usingCurvilinearGrid ) THEN
62 edhill 1.21 CALL INI_CURVILINEAR_GRID( myThid )
63 afe 1.17 ELSEIF ( usingCylindricalGrid ) THEN
64 edhill 1.21 CALL INI_CYLINDER( myThid )
65 cnh 1.1 ELSE
66 edhill 1.21 _BEGIN_MASTER(myThid)
67     WRITE(msgBuf,'(2A)') 'S/R INI_GRID: ',
68     & 'No grid coordinate system has been selected'
69     CALL PRINT_ERROR( msgBuf , myThid)
70     STOP 'ABNORMAL END: S/R INI_GRID'
71     _END_MASTER(myThid)
72 cnh 1.1 ENDIF
73 dimitri 1.15
74 adcroft 1.20 #ifdef ALLOW_MONITOR
75 edhill 1.21 mon_write_stdout = .FALSE.
76     mon_write_mnc = .FALSE.
77     IF (monitor_stdio) THEN
78     mon_write_stdout = .TRUE.
79     ENDIF
80    
81     #ifdef ALLOW_MNC
82     IF (useMNC .AND. monitor_mnc) THEN
83     DO i = 1,MAX_LEN_MBUF
84     mon_fname(i:i) = ' '
85     ENDDO
86     mon_fname(1:12) = 'monitor_grid'
87     CALL MNC_CW_SET_UDIM(mon_fname, 1, myThid)
88     mon_write_mnc = .TRUE.
89     ENDIF
90     #endif /* ALLOW_MNC */
91    
92     C Print out statistics of each horizontal grid array (helps when
93     C debugging)
94 adcroft 1.9 CALL MON_PRINTSTATS_RS(1,XC,'XC',myThid)
95     CALL MON_PRINTSTATS_RS(1,XG,'XG',myThid)
96     CALL MON_PRINTSTATS_RS(1,DXC,'DXC',myThid)
97     CALL MON_PRINTSTATS_RS(1,DXF,'DXF',myThid)
98     CALL MON_PRINTSTATS_RS(1,DXG,'DXG',myThid)
99     CALL MON_PRINTSTATS_RS(1,DXV,'DXV',myThid)
100     CALL MON_PRINTSTATS_RS(1,YC,'YC',myThid)
101     CALL MON_PRINTSTATS_RS(1,YG,'YG',myThid)
102     CALL MON_PRINTSTATS_RS(1,DYC,'DYC',myThid)
103     CALL MON_PRINTSTATS_RS(1,DYF,'DYF',myThid)
104     CALL MON_PRINTSTATS_RS(1,DYG,'DYG',myThid)
105     CALL MON_PRINTSTATS_RS(1,DYU,'DYU',myThid)
106     CALL MON_PRINTSTATS_RS(1,RA,'RA',myThid)
107     CALL MON_PRINTSTATS_RS(1,RAW,'RAW',myThid)
108     CALL MON_PRINTSTATS_RS(1,RAS,'RAS',myThid)
109     CALL MON_PRINTSTATS_RS(1,RAZ,'RAZ',myThid)
110 edhill 1.21
111     mon_write_stdout = .FALSE.
112     mon_write_mnc = .FALSE.
113 heimbach 1.12 #endif
114 adcroft 1.8
115 cnh 1.1 RETURN
116     END

  ViewVC Help
Powered by ViewVC 1.1.22