New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
in_out_manager.F90 in trunk/NEMO/OFF_SRC/IOM – NEMO

source: trunk/NEMO/OFF_SRC/IOM/in_out_manager.F90 @ 1312

Last change on this file since 1312 was 1312, checked in by smasson, 15 years ago

add a namelist logical to mask land points in NetCDF outputs, see ticket:322

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.7 KB
Line 
1MODULE in_out_manager   
2   !!======================================================================
3   !!                       ***  MODULE  in_out_manager  ***
4   !! Ocean physics:  vertical mixing coefficient compute from the tke
5   !!                 turbulent closure parameterization
6   !!=====================================================================
7   !! History :   8.5  !  02-06  (G. Madec)  original code
8   !!             9.0  !  06-07  (S. Masson)  iom, add ctl_stop, ctl_warn
9   !!----------------------------------------------------------------------
10
11   !!----------------------------------------------------------------------
12   !!   ctl_stop   : update momentum and tracer Kz from a tke scheme
13   !!   ctl_warn   : initialization, namelist read, and parameters control
14   !!----------------------------------------------------------------------
15   USE par_kind
16   USE par_oce
17   USE lib_print         ! formated print library
18
19   IMPLICIT NONE
20   PUBLIC
21
22   !!----------------------------------------------------------------------
23   !!                   namrun namelist parameters
24   !!----------------------------------------------------------------------
25   CHARACTER (len=16) ::   cexper     = "exp0"    !: experiment name used for output filename
26   LOGICAL            ::   ln_rstart  = .FALSE.   !: start from (F) rest or (T) a restart file
27   INTEGER            ::   no         = 0         !: job number
28   INTEGER            ::   nrstdt     = 0         !: control of the time step (0, 1 or 2)
29   INTEGER            ::   nn_rstssh  = 0         !: hand made initilization of ssh or not (1/0)
30   INTEGER            ::   nit000     = 1         !: index of the first time step
31   INTEGER            ::   nitend     = 10        !: index of the last time step
32   INTEGER            ::   ndate0     = 961115    !: initial calendar date aammjj
33   INTEGER            ::   nleapy     = 0         !: Leap year calendar flag (0/1 or 30)
34   INTEGER            ::   ninist     = 0         !: initial state output flag (0/1)
35   LOGICAL            ::   ln_dimgnnn = .FALSE.   !: type of dimgout. (F): 1 file for all proc
36                                                  !:                  (T): 1 file per proc
37   LOGICAL            ::   ln_mskland = .FALSE.   !: mask land points in NetCDF outputs (costly: + ~15%)
38   !!----------------------------------------------------------------------
39   !! was in restart but moved here because of the OFF line... better solution should be found...
40   !!----------------------------------------------------------------------
41   INTEGER            ::   nitrst                 !: time step at which restart file should be written
42   !!----------------------------------------------------------------------
43   !!                    output monitoring
44   !!----------------------------------------------------------------------
45   LOGICAL            ::   ln_ctl     = .FALSE.   !: run control for debugging
46   INTEGER            ::   nstock     =   10      !: restart file frequency
47   INTEGER            ::   nprint     =    0      !: level of print (0 no print)
48   INTEGER            ::   nwrite     =   10      !: restart file frequency
49   INTEGER            ::   nictls     =    0      !: Start i indice for the SUM control
50   INTEGER            ::   nictle     =    0      !: End   i indice for the SUM control
51   INTEGER            ::   njctls     =    0      !: Start j indice for the SUM control
52   INTEGER            ::   njctle     =    0      !: End   j indice for the SUM control
53   INTEGER            ::   isplt      =    1      !: number of processors following i
54   INTEGER            ::   jsplt      =    1      !: number of processors following j
55   INTEGER            ::   ijsplt     =    1      !: nb of local domain = nb of processors
56   INTEGER            ::   nbench     =    0      !: benchmark parameter (0/1)
57   INTEGER            ::   nbit_cmp   =    0      !: bit reproducibility  (0/1)
58   !!----------------------------------------------------------------------
59   !!                        logical units
60   !!----------------------------------------------------------------------
61   INTEGER            ::   numstp                 !: logical unit for time step
62   INTEGER            ::   numout                 !: logical unit for output print
63   INTEGER            ::   numnam                 !: logical unit for namelist
64   INTEGER            ::   numnam_ice             !: logical unit for ice namelist
65   INTEGER            ::   numevo_ice             !: logical unit for ice variables (temp. evolution)
66   INTEGER            ::   numsol                 !: logical unit for solver statistics
67   INTEGER            ::   numwri                 !: logical unit for output write
68   INTEGER            ::   numisp                 !: logical unit for island statistics
69   INTEGER            ::   numgap                 !: logical unit for differences diagnostic
70   INTEGER            ::   numbol                 !: logical unit for "bol" diagnostics
71   INTEGER            ::   numptr                 !: logical unit for Poleward TRansports
72   INTEGER            ::   numflo                 !: logical unit for drifting floats
73
74   !!----------------------------------------------------------------------
75   !!                          Run control 
76   !!----------------------------------------------------------------------
77
78   INTEGER            ::   nstop = 0                !: error flag (=number of reason for a premature stop run)
79   INTEGER            ::   nwarn = 0                !: warning flag (=number of warning found during the run)
80   CHARACTER(len=200) ::   ctmp1, ctmp2, ctmp3      !: temporary character
81   CHARACTER (len=64) ::   cform_err = "(/,' ===>>> : E R R O R',     /,'         ===========',/)"       !:
82   CHARACTER (len=64) ::   cform_war = "(/,' ===>>> : W A R N I N G', /,'         ===============',/)"   !:
83   LOGICAL            ::   lwp                      !: boolean : true on the 1st processor only
84   LOGICAL            ::   lsp_area = .TRUE.        !: to make a control print over a specific area
85   !!----------------------------------------------------------------------
86   !!  OPA 9.0 , LOCEAN-IPSL (2005)
87   !! $Id$
88   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
89   !!----------------------------------------------------------------------
90
91CONTAINS
92
93   SUBROUTINE ctl_stop( cd1, cd2, cd3, cd4, cd5,   &
94      &                 cd6, cd7, cd8, cd9, cd10 )
95      !!-----------------------------------------------------------------------
96      !!                  ***  ROUTINE  stop_opa  ***
97      !!
98      !! ** Purpose : ??? blah blah....
99      !!-----------------------------------------------------------------------
100      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd1, cd2, cd3, cd4, cd5
101      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd6, cd7, cd8, cd9, cd10
102      !!-----------------------------------------------------------------------
103      !
104      nstop = nstop + 1 
105      IF(lwp) THEN
106         WRITE(numout,"(/,' ===>>> : E R R O R',     /,'         ===========',/)") 
107         IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1
108         IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2
109         IF( PRESENT(cd3 ) ) WRITE(numout,*) cd3
110         IF( PRESENT(cd4 ) ) WRITE(numout,*) cd4
111         IF( PRESENT(cd5 ) ) WRITE(numout,*) cd5
112         IF( PRESENT(cd6 ) ) WRITE(numout,*) cd6
113         IF( PRESENT(cd7 ) ) WRITE(numout,*) cd7
114         IF( PRESENT(cd8 ) ) WRITE(numout,*) cd8
115         IF( PRESENT(cd9 ) ) WRITE(numout,*) cd9
116         IF( PRESENT(cd10) ) WRITE(numout,*) cd10
117      ENDIF
118      CALL FLUSH(numout)
119      !
120   END SUBROUTINE ctl_stop
121
122
123   SUBROUTINE ctl_warn( cd1, cd2, cd3, cd4, cd5,   &
124      &                 cd6, cd7, cd8, cd9, cd10 )
125      !!-----------------------------------------------------------------------
126      !!                  ***  ROUTINE  stop_warn  ***
127      !!
128      !! ** Purpose : ???  blah blah....
129      !!-----------------------------------------------------------------------
130      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd1, cd2, cd3, cd4, cd5
131      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd6, cd7, cd8, cd9, cd10
132      !!-----------------------------------------------------------------------
133      !
134      nwarn = nwarn + 1 
135      IF(lwp) THEN
136         WRITE(numout,"(/,' ===>>> : W A R N I N G', /,'         ===============',/)") 
137         IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1
138         IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2
139         IF( PRESENT(cd3 ) ) WRITE(numout,*) cd3
140         IF( PRESENT(cd4 ) ) WRITE(numout,*) cd4
141         IF( PRESENT(cd5 ) ) WRITE(numout,*) cd5
142         IF( PRESENT(cd6 ) ) WRITE(numout,*) cd6
143         IF( PRESENT(cd7 ) ) WRITE(numout,*) cd7
144         IF( PRESENT(cd8 ) ) WRITE(numout,*) cd8
145         IF( PRESENT(cd9 ) ) WRITE(numout,*) cd9
146         IF( PRESENT(cd10) ) WRITE(numout,*) cd10
147      ENDIF
148      CALL FLUSH(numout)
149      !
150   END SUBROUTINE ctl_warn
151
152
153   FUNCTION getunit()
154     !!-----------------------------------------------------------------------
155     !!                  ***  FUNCTION  getunit  ***
156     !!
157     !! ** Purpose : ???  blah blah....
158     !!-----------------------------------------------------------------------
159     INTEGER :: getunit
160     LOGICAL :: llopn 
161     !---------------------------------------------------------------------
162     getunit = 15   ! choose a unit that is big enough then it is
163                    !  not already used in OPA
164     llopn = .TRUE.
165     DO WHILE( (getunit < 998) .AND. llopn )
166        getunit = getunit + 1
167        INQUIRE( unit = getunit, opened = llopn )
168     END DO
169     IF( (getunit == 999) .AND. llopn ) THEN
170        CALL ctl_stop( 'getunit: All logical units until 999 are used...' )
171        getunit = -1
172     ENDIF
173
174   END FUNCTION getunit
175
176   !!=====================================================================
177END MODULE in_out_manager
Note: See TracBrowser for help on using the repository browser.