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

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

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

revision 1.5 by cnh, Fri Nov 6 22:44:47 1998 UTC revision 1.14 by jmc, Sun Nov 23 04:19:11 2003 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2    C $Name$
3    
4    #include "PACKAGES_CONFIG.h"
5  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
6    
7  CStartOfInterface  CBOP
8    C     !ROUTINE: INI_GRID
9    C     !INTERFACE:
10        SUBROUTINE INI_GRID( myThid )        SUBROUTINE INI_GRID( myThid )
11  C     /==========================================================\  C     !DESCRIPTION: \bv
12  C     | SUBROUTINE INI_GRID                                      |  C     *==========================================================*
13  C     | o Initialise model grid                                  |  C     | SUBROUTINE INI_GRID                                      
14  C     |==========================================================|  C     | o Initialise model grid                                  
15  C     | These arrays are used throughout the code in evaluating  |  C     *==========================================================*
16  C     | gradients, integrals and spatial avarages. This routine  |  C     | These arrays are used throughout the code in evaluating  
17  C     | is called separately by each thread and initialise only  |  C     | gradients, integrals and spatial avarages. This routine  
18  C     | the region of the domain it is "responsible" for.        |  C     | is called separately by each thread and initialise only  
19  C     | Notes:                                                   |  C     | the region of the domain it is "responsible" for.        
20  C     | Two examples are shown in this code. One illustrates the |  C     | Notes:                                                    
21  C     | initialisation of a cartesian grid. The other shows the  |  C     | Two examples are shown in this code. One illustrates the  
22  C     | inialisation of a spherical polar grid. Other orthonormal|  C     | initialisation of a cartesian grid. The other shows the  
23  C     | grids can be fitted into this design. In this case       |  C     | inialisation of a spherical polar grid. Other orthonormal
24  C     | custom metric terms also need adding to account for the  |  C     | grids can be fitted into this design. In this case        
25  C     | projections of velocity vectors onto these grids.        |  C     | custom metric terms also need adding to account for the  
26  C     | The structure used here also makes it possible to        |  C     | projections of velocity vectors onto these grids.        
27  C     | implement less regular grid mappings. In particular      |  C     | The structure used here also makes it possible to        
28  C     | o Schemes which leave out blocks of the domain that are  |  C     | implement less regular grid mappings. In particular      
29  C     |   all land could be supported.                           |  C     | o Schemes which leave out blocks of the domain that are  
30  C     | o Multi-level schemes such as icosohedral or cubic       |  C     |   all land could be supported.                            
31  C     |   grid projectedions onto a sphere can also be fitted    |  C     | o Multi-level schemes such as icosohedral or cubic        
32  C     |   within the strategy we use.                            |  C     |   grid projectedions onto a sphere can also be fitted    
33  C     |   Both of the above also require modifying the support   |  C     |   within the strategy we use.                            
34  C     |   routines that map computational blocks to simulation   |  C     |   Both of the above also require modifying the support    
35  C     |   domain blocks.                                         |  C     |   routines that map computational blocks to simulation    
36  C     \==========================================================/  C     |   domain blocks.                                          
37    C     *==========================================================*
38    C     \ev
39    
40    C     !USES:
41          IMPLICIT NONE
42  C     === Global variables ===  C     === Global variables ===
43  #include "SIZE.h"  #include "SIZE.h"
44  #include "EEPARAMS.h"  #include "EEPARAMS.h"
45  #include "PARAMS.h"  #include "PARAMS.h"
46  #include "GRID.h"  #include "GRID.h"
47    
48    C     !INPUT/OUTPUT PARAMETERS:
49  C     == Routine arguments ==  C     == Routine arguments ==
50  C     myThid -  Number of this instance of INI_GRID  C     myThid -  Number of this instance of INI_GRID
51        INTEGER myThid        INTEGER myThid
 CEndOfInterface  
52    
53    C     !LOCAL VARIABLES:
54  C     == Local variables ==  C     == Local variables ==
55  C     msgBuf - Used for informational I/O.  C     msgBuf - Used for informational I/O.
56        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
57    CEOP
58    
59  C--   Set up vertical grid and coordinate system  C--   Set up vertical grid and coordinate system
60        CALL INI_VERTICAL_GRID( myThid )        CALL INI_VERTICAL_GRID( myThid )
# Line 54  C--   Set up horizontal grid and coordin Line 64  C--   Set up horizontal grid and coordin
64         CALL INI_CARTESIAN_GRID( myThid )         CALL INI_CARTESIAN_GRID( myThid )
65        ELSEIF ( usingSphericalPolarGrid ) THEN        ELSEIF ( usingSphericalPolarGrid ) THEN
66         CALL INI_SPHERICAL_POLAR_GRID( myThid )         CALL INI_SPHERICAL_POLAR_GRID( myThid )
67          ELSEIF ( usingCurvilinearGrid ) THEN
68           CALL INI_CURVILINEAR_GRID( myThid )
69        ELSE        ELSE
70         _BEGIN_MASTER(myThid)         _BEGIN_MASTER(myThid)
71          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
# Line 62  C--   Set up horizontal grid and coordin Line 74  C--   Set up horizontal grid and coordin
74           STOP 'ABNORMAL END: S/R INI_GRID'           STOP 'ABNORMAL END: S/R INI_GRID'
75         _END_MASTER(myThid)         _END_MASTER(myThid)
76        ENDIF        ENDIF
77  C  
78    C--   Write certain grid data to files (useful for creating netCDF
79    C     and general post-analysis)
80          CALL WRITE_FLD_XY_RS( 'XC',' ',XC,0,myThid)
81          CALL WRITE_FLD_XY_RS( 'YC',' ',YC,0,myThid)
82          CALL WRITE_FLD_XY_RS( 'XG',' ',XG,0,myThid)
83          CALL WRITE_FLD_XY_RS( 'YG',' ',YG,0,myThid)
84          CALL WRITE_FLD_XY_RS( 'RAC',' ',rA,0,myThid)
85          CALL WRITE_FLD_XY_RS( 'RAW',' ',rAw,0,myThid)
86          CALL WRITE_FLD_XY_RS( 'RAS',' ',rAs,0,myThid)
87          CALL WRITE_FLD_XY_RS( 'DXG',' ',DXG,0,myThid)
88          CALL WRITE_FLD_XY_RS( 'DYG',' ',DYG,0,myThid)
89          CALL WRITE_FLD_XY_RS( 'DXC',' ',DXC,0,myThid)
90          CALL WRITE_FLD_XY_RS( 'DYC',' ',DYC,0,myThid)
91    
92    C--   Print out statistics of each horizontal grid array (helps when debugging)
93    
94    #ifdef ALLOW_MONITOR
95          CALL MON_PRINTSTATS_RS(1,XC,'XC',myThid)
96          CALL MON_PRINTSTATS_RS(1,XG,'XG',myThid)
97          CALL MON_PRINTSTATS_RS(1,DXC,'DXC',myThid)
98          CALL MON_PRINTSTATS_RS(1,DXF,'DXF',myThid)
99          CALL MON_PRINTSTATS_RS(1,DXG,'DXG',myThid)
100          CALL MON_PRINTSTATS_RS(1,DXV,'DXV',myThid)
101          CALL MON_PRINTSTATS_RS(1,YC,'YC',myThid)
102          CALL MON_PRINTSTATS_RS(1,YG,'YG',myThid)
103          CALL MON_PRINTSTATS_RS(1,DYC,'DYC',myThid)
104          CALL MON_PRINTSTATS_RS(1,DYF,'DYF',myThid)
105          CALL MON_PRINTSTATS_RS(1,DYG,'DYG',myThid)
106          CALL MON_PRINTSTATS_RS(1,DYU,'DYU',myThid)
107          CALL MON_PRINTSTATS_RS(1,RA,'RA',myThid)
108          CALL MON_PRINTSTATS_RS(1,RAW,'RAW',myThid)
109          CALL MON_PRINTSTATS_RS(1,RAS,'RAS',myThid)
110          CALL MON_PRINTSTATS_RS(1,RAZ,'RAZ',myThid)
111    #endif
112    
113        RETURN        RETURN
114        END        END

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.22