/[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.27 - (hide annotations) (download)
Mon Nov 7 18:26:02 2005 UTC (18 years, 6 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint58b_post, checkpoint57y_post, checkpoint58, checkpoint58f_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint58m_post, checkpoint57y_pre, checkpoint58e_post, checkpoint58k_post, checkpoint58l_post, checkpoint58g_post, checkpoint58h_post, checkpoint58j_post, checkpoint58i_post, checkpoint57x_post, checkpoint58c_post
Changes since 1.26: +3 -1 lines
Added some _BARRIER statements to get correct multi-threaded behavior
for initializations followed by master thread I/O.

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

  ViewVC Help
Powered by ViewVC 1.1.22