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.
opa.F90 in trunk/NEMO/OFF_SRC – NEMO

source: trunk/NEMO/OFF_SRC/opa.F90 @ 1326

Last change on this file since 1326 was 1326, checked in by cetlod, 15 years ago

suppression of useless CPP key key_mpp_omp, see ticket:350

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.7 KB
Line 
1MODULE opa
2   !!==============================================================================
3   !!                       ***  MODULE opa   ***
4   !! Ocean system   : OPA ocean dynamics (including on-line tracers and sea-ice)
5   !!==============================================================================
6
7   !!----------------------------------------------------------------------
8   !!   opa_model      : solve ocean dynamics, tracer and/or sea-ice
9   !!----------------------------------------------------------------------
10   !! * Modules used
11   USE dom_oce         ! ocean space domain variables
12   USE oce             ! dynamics and tracers variables
13   USE daymod          ! calendar
14   USE in_out_manager  ! I/O manager
15   USE lib_mpp         ! distributed memory computing
16
17   USE domcfg          ! domain configuration               (dom_cfg routine)
18   USE mppini          ! shared/distributed memory setting (mpp_init routine)
19   USE domain          ! domain initialization             (dom_init routine)
20   USE istate          ! initial state setting          (istate_init routine)
21   USE eosbn2          ! equation of state            (eos bn2 routine)
22
23   ! ocean physics
24   USE ldftra          ! lateral diffusivity setting    (ldftra_init routine)
25   USE traqsr          ! solar radiation penetration   (tra_qsr_init routine)
26
27   USE phycst          ! physical constant                  (par_cst routine)
28   USE dtadyn          ! Lecture and Interpolation of the dynamical fields
29   USE trcini          ! Initilization of the passive tracers
30   USE step            ! OPA time-stepping                  (stp     routine)
31
32   IMPLICIT NONE
33   PRIVATE
34
35   !! * Module variables
36   CHARACTER (len=64) ::        &
37      cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing
38
39   !! * Routine accessibility
40   PUBLIC opa_model      ! called by model.F90
41   PUBLIC opa_init
42   !!----------------------------------------------------------------------
43   !!   OPA 9.0 , LOCEAN-IPSL  (2005)
44   !!   $Id$
45   !!   This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
46   !!----------------------------------------------------------------------
47
48CONTAINS
49
50   SUBROUTINE opa_model
51      !!----------------------------------------------------------------------
52      !!                     ***  ROUTINE opa  ***
53      !!
54      !! ** Purpose :   opa solves the primitive equations on an orthogonal
55      !!      curvilinear mesh on the sphere.
56      !!
57      !! ** Method  : - model general initialization
58      !!              - launch the time-stepping (stp routine)
59      !!
60      !! References :
61      !!      Madec, Delecluse,Imbard, and Levy, 1997: reference manual.
62      !!              internal report, IPSL.
63      !!----------------------------------------------------------------------
64      INTEGER ::   istp       ! time step index
65      !!----------------------------------------------------------------------
66
67      CALL opa_init  ! Initializations
68
69      IF( lk_mpp )   CALL mpp_max( nstop )
70
71      ! check that all process are still there... If some process have an error,
72      ! they will never enter in step and other processes will wait until the end of the cpu time!
73      IF( lk_mpp )   CALL mpp_max( nstop )
74
75      istp = nit000
76         !
77      DO WHILE ( istp <= nitend .AND. nstop == 0 )
78         CALL stp( istp )
79         istp = istp + 1
80         IF( lk_mpp )   CALL mpp_max( nstop )
81      END DO
82      !                                     ! ========= !
83      !                                     !  Job end  !
84      !                                     ! ========= !
85
86      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
87
88      IF( nstop /= 0 .AND. lwp ) THEN                 ! error print
89         WRITE(numout,cform_err)
90         WRITE(numout,*) nstop, ' error have been found'
91      ENDIF
92
93      CALL opa_closefile
94
95      IF( lk_mpp )   CALL mppstop                          ! Close all files (mpp)
96      !
97   END SUBROUTINE opa_model
98
99
100   SUBROUTINE opa_init
101      !!----------------------------------------------------------------------
102      !!                     ***  ROUTINE opa_init ***
103      !!
104      !! ** Purpose :   opa solves the primitive equations on an orthogonal
105      !!      curvilinear mesh on the sphere.
106      !!
107      !! ** Method  : - model general initialization
108      !!
109      !! References :
110      !!      Madec, Delecluse,Imbard, and Levy, 1997: reference manual.
111      !!              internal report, IPSL.
112      !!
113      !! History :
114      !!   4.0  !  90-10  (C. Levy, G. Madec)  Original code
115      !!   7.0  !  91-11  (M. Imbard, C. Levy, G. Madec)
116      !!   7.1  !  93-03  (M. Imbard, C. Levy, G. Madec, O. Marti,
117      !!                   M. Guyon, A. Lazar, P. Delecluse, C. Perigaud,
118      !!                   G. Caniaux, B. Colot, C. Maes ) release 7.1
119      !!        !  92-06  (L.Terray) coupling implementation
120      !!        !  93-11  (M.A. Filiberti) IGLOO sea-ice
121      !!   8.0  !  96-03  (M. Imbard, C. Levy, G. Madec, O. Marti,
122      !!                   M. Guyon, A. Lazar, P. Delecluse, L.Terray,
123      !!                   M.A. Filiberti, J. Vialar, A.M. Treguier,
124      !!                   M. Levy)  release 8.0
125      !!   8.1  !  97-06  (M. Imbard, G. Madec)
126      !!   8.2  !  99-11  (M. Imbard, H. Goosse)  LIM sea-ice model
127      !!        !  99-12  (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols)  OPEN-MP
128      !!        !  00-07  (J-M Molines, M. Imbard)  Open Boundary Conditions  (CLIPPER)
129      !!   9.0  !  02-08  (G. Madec)  F90: Free form and modules
130      !!----------------------------------------------------------------------
131      !! * Local declarations
132      CHARACTER (len=20) ::   namelistname
133      CHARACTER (len=28) ::   file_out
134
135      !!----------------------------------------------------------------------
136
137      ! Initializations
138      ! ===============
139
140      file_out = 'ocean.output'
141
142      ! open listing and namelist units
143      CALL ctlopn( numout, file_out, 'UNKNOWN', 'FORMATTED',   &
144         &         'SEQUENTIAL', 1, 6, .FALSE., 1 )
145
146      namelistname = 'namelist'
147      CALL ctlopn( numnam, namelistname, 'OLD', 'FORMATTED', 'SEQUENTIAL',   &
148         &         1, numout, .FALSE., 1 )
149
150      WRITE(numout,*)
151      WRITE(numout,*) '                 L O D Y C - I P S L'
152      WRITE(numout,*) '                     O P A model'
153      WRITE(numout,*) '            Ocean General Circulation Model'
154      WRITE(numout,*) '               version OPA 9.0  (2005) '
155      WRITE(numout,*)
156      WRITE(numout,*)
157
158      ! Nodes selection
159      narea = mynode()
160      narea = narea + 1    ! mynode return the rank of proc (0 --> jpnij -1 )
161      lwp   = narea == 1
162
163      ! open additionnal listing
164      IF( ln_ctl )   THEN
165         IF( narea-1 > 0 )   THEN
166            WRITE(file_out,FMT="('ocean.output_',I4.4)") narea-1
167            CALL ctlopn( numout, file_out, 'UNKNOWN', 'FORMATTED',   &
168               &         'SEQUENTIAL', 1, numout, .FALSE., 1 )
169            lwp = .TRUE.
170            !
171            WRITE(numout,*)
172            WRITE(numout,*) '                 L O D Y C - I P S L'
173            WRITE(numout,*) '                     O P A model'
174            WRITE(numout,*) '            Ocean General Circulation Model'
175            WRITE(numout,*) '               version OPA 9.0  (2005) '
176            WRITE(numout,*) '                   MPI Ocean output '
177            WRITE(numout,*)
178            WRITE(numout,*)
179         ENDIF
180      ENDIF
181
182      !                                     ! ============================== !
183      !                                     !  Model general initialization  !
184      !                                     ! ============================== !
185
186      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
187
188                                            ! Domain decomposition
189      IF( jpni * jpnj == jpnij ) THEN
190         CALL mpp_init                          ! standard cutting out
191      ELSE
192         CALL mpp_init2                         ! eliminate land processors
193      ENDIF
194     
195      CALL phy_cst                          ! Physical constants
196
197      CALL dom_cfg                          ! Domain configuration
198
199      CALL dom_init                         ! Domain
200
201      CALL istate_init                      ! ocean initial state (Dynamics and tracers)
202
203      CALL day_init                          ! Calendar
204
205      CALL dta_dyn( nit000 )                 ! Initialization for the dynamics
206      !                                     ! Ocean physics
207      CALL tra_qsr_init                         ! Solar radiation penetration
208
209      CALL trc_ini                           ! Passive tracers
210
211#if ! defined key_off_degrad
212      CALL ldf_tra_init                         ! Lateral ocean tracer physics
213#endif 
214      !                                     ! =============== !
215      !                                     !  time stepping  !
216      !                                     ! =============== !
217
218      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
219
220   END SUBROUTINE opa_init
221
222   SUBROUTINE opa_closefile
223      !!----------------------------------------------------------------------
224      !!                     ***  ROUTINE opa_closefile  ***
225      !!
226      !! ** Purpose :   Close the files
227      !!
228      !! ** Method  :
229      !!
230      !! History :
231      !!   9.0  !  05-01  (O. Le Galloudec)  Original code
232      !!----------------------------------------------------------------------
233      !!----------------------------------------------------------------------
234
235      IF ( lk_mpp ) CALL mppsync
236
237      ! 1. Unit close
238      ! -------------
239
240      CLOSE( numnam )           ! namelist
241      CLOSE( numout )           ! standard model output file
242
243      IF(lwp) CLOSE( numstp )   ! time-step file
244
245   END SUBROUTINE opa_closefile
246
247   !!======================================================================
248END MODULE opa
Note: See TracBrowser for help on using the repository browser.