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

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

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


Revision 1.26 - (show annotations) (download)
Fri Nov 4 01:19:24 2005 UTC (18 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.25: +3 -1 lines
remove unused variables (reduces number of compiler warning)

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

  ViewVC Help
Powered by ViewVC 1.1.22