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/OPA_SRC/IOM – NEMO

source: trunk/NEMO/OPA_SRC/IOM/in_out_manager.F90 @ 548

Last change on this file since 548 was 548, checked in by opalod, 18 years ago

nemo_v1_update_078:RB: finalization of IOM (2)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 9.0 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   LOGICAL            ::   ln_ctl     = .FALSE.   !: run control for debugging
28   INTEGER            ::   no         = 0         !: job number
29   INTEGER            ::   nrstdt     = 0         !: control of the time step (0, 1 or 2)
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   
36   !!----------------------------------------------------------------------
37   !!                    output monitoring
38   !!----------------------------------------------------------------------
39   INTEGER            ::   nstock     =   10      !: restart file frequency
40   INTEGER            ::   nprint     =    0      !: level of print (0 no print)
41   INTEGER            ::   nwrite     =   10      !: restart file frequency
42   INTEGER            ::   nictls     =    0      !: Start i indice for the SUM control
43   INTEGER            ::   nictle     =    0      !: End   i indice for the SUM control
44   INTEGER            ::   njctls     =    0      !: Start j indice for the SUM control
45   INTEGER            ::   njctle     =    0      !: End   j indice for the SUM control
46   INTEGER            ::   isplt      =    1      !: number of processors following i
47   INTEGER            ::   jsplt      =    1      !: number of processors following j
48   INTEGER            ::   ijsplt     =    1      !: nb of local domain = nb of processors
49   INTEGER            ::   nbench     = 0         !: benchmark parameter (0/1)
50   INTEGER            ::   nbit_cmp   = 0         !: bit reproducibility  (0/1)
51
52   !!----------------------------------------------------------------------
53   !!                        logical units
54   !!----------------------------------------------------------------------
55   INTEGER            ::   numstp     =  1        !: logical unit for time step
56   INTEGER            ::   numout     =  2        !: logical unit for output print
57   INTEGER            ::   numnam     =  3        !: logical unit for namelist
58   INTEGER            ::   numnam_ice =  4        !: logical unit for ice namelist
59   INTEGER            ::   numevo_ice = 17        !: logical unit for ice variables (temp. evolution)
60   INTEGER            ::   numsol     = 25        !: logical unit for solver statistics
61   INTEGER            ::   numwri     = 40        !: logical unit for output write
62   INTEGER            ::   numisp     = 41        !: logical unit for island statistics
63   INTEGER            ::   numgap     = 45        !: logical unit for differences diagnostic
64   INTEGER            ::   numbol     = 67        !: logical unit for "bol" diagnostics
65   INTEGER            ::   numptr     = 68        !: logical unit for Poleward TRansports
66   INTEGER            ::   numflo     = 69        !: logical unit for drifting floats
67
68   !!----------------------------------------------------------------------
69   !!                          Run control 
70   !!----------------------------------------------------------------------
71   
72   INTEGER            ::   nstop = 0                !: error flag (=number of reason for a premature stop run)
73   INTEGER            ::   nwarn = 0                !: warning flag (=number of warning found during the run)
74   CHARACTER(LEN=100) ::   ctmp1, ctmp2, ctmp3      !: temporary character
75   CHARACTER (len=64) ::   cform_err = "(/,' ===>>> : E R R O R',     /,'         ===========',/)"       !:
76   CHARACTER (len=64) ::   cform_war = "(/,' ===>>> : W A R N I N G', /,'         ===============',/)"   !:
77   LOGICAL            ::   lwp                      !: boolean : true on the 1st processor only
78   LOGICAL            ::   lsp_area = .TRUE.        !: to make a control print over a specific area
79   !!----------------------------------------------------------------------
80   !!  OPA 9.0 , LOCEAN-IPSL (2005)
81   !! $Header$
82   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
83   !!----------------------------------------------------------------------
84
85CONTAINS
86
87   SUBROUTINE ctl_stop( cd1, cd2, cd3, cd4, cd5,   &
88      &                 cd6, cd7, cd8, cd9, cd10 )
89      !!-----------------------------------------------------------------------
90      !!                  ***  ROUTINE  stop_opa  ***
91      !!
92      !! ** Purpose : ??? blah blah....
93      !!-----------------------------------------------------------------------
94      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd1, cd2, cd3, cd4, cd5
95      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd6, cd7, cd8, cd9, cd10
96      !!-----------------------------------------------------------------------
97      !
98      nstop = nstop + 1 
99      IF(lwp) THEN
100         WRITE(numout,"(/,' ===>>> : E R R O R',     /,'         ===========',/)") 
101         IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1
102         IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2
103         IF( PRESENT(cd3 ) ) WRITE(numout,*) cd3
104         IF( PRESENT(cd4 ) ) WRITE(numout,*) cd4
105         IF( PRESENT(cd5 ) ) WRITE(numout,*) cd5
106         IF( PRESENT(cd6 ) ) WRITE(numout,*) cd6
107         IF( PRESENT(cd7 ) ) WRITE(numout,*) cd7
108         IF( PRESENT(cd8 ) ) WRITE(numout,*) cd8
109         IF( PRESENT(cd9 ) ) WRITE(numout,*) cd9
110         IF( PRESENT(cd10) ) WRITE(numout,*) cd10
111      ENDIF
112      CALL FLUSH(numout)
113      !
114   END SUBROUTINE ctl_stop
115
116
117   SUBROUTINE ctl_warn( cd1, cd2, cd3, cd4, cd5,   &
118      &                 cd6, cd7, cd8, cd9, cd10 )
119      !!-----------------------------------------------------------------------
120      !!                  ***  ROUTINE  stop_warn  ***
121      !!
122      !! ** Purpose : ???  blah blah....
123      !!-----------------------------------------------------------------------
124      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd1, cd2, cd3, cd4, cd5
125      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd6, cd7, cd8, cd9, cd10
126      !!-----------------------------------------------------------------------
127      !
128      nwarn = nwarn + 1 
129      IF(lwp) THEN
130         WRITE(numout,"(/,' ===>>> : W A R N I N G', /,'         ===============',/)") 
131         IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1
132         IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2
133         IF( PRESENT(cd3 ) ) WRITE(numout,*) cd3
134         IF( PRESENT(cd4 ) ) WRITE(numout,*) cd4
135         IF( PRESENT(cd5 ) ) WRITE(numout,*) cd5
136         IF( PRESENT(cd6 ) ) WRITE(numout,*) cd6
137         IF( PRESENT(cd7 ) ) WRITE(numout,*) cd7
138         IF( PRESENT(cd8 ) ) WRITE(numout,*) cd8
139         IF( PRESENT(cd9 ) ) WRITE(numout,*) cd9
140         IF( PRESENT(cd10) ) WRITE(numout,*) cd10
141      ENDIF
142      CALL FLUSH(numout)
143      !
144   END SUBROUTINE ctl_warn
145
146
147   FUNCTION getunit()
148     !!-----------------------------------------------------------------------
149     !!                  ***  FUNCTION  getunit  ***
150     !!
151     !! ** Purpose : ???  blah blah....
152     !!-----------------------------------------------------------------------
153     INTEGER :: getunit
154     LOGICAL :: llopn 
155     !---------------------------------------------------------------------
156     getunit = 50   ! choose a unit that is big enough then it is
157                    !  not already used in OPA
158     llopn = .TRUE.
159     DO WHILE( (getunit < 998) .AND. llopn )
160        getunit = getunit + 1
161        INQUIRE( unit = getunit, opened = llopn )
162     END DO
163     IF( (getunit == 999) .AND. llopn ) THEN
164        CALL ctl_stop( 'getunit: All logical units until 999 are used...' )
165        getunit = -1
166     ENDIF
167     
168   END FUNCTION getunit
169
170   !!=====================================================================
171END MODULE in_out_manager
Note: See TracBrowser for help on using the repository browser.