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 @ 1291

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

update modules, see ticket:320

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.9 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   !! * Routine accessibility
36   PUBLIC opa_model      ! called by model.F90
37   !!----------------------------------------------------------------------
38   !!   OPA 9.0 , LOCEAN-IPSL  (2005)
39   !!   $Id$
40   !!   This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
41   !!----------------------------------------------------------------------
42
43CONTAINS
44
45   SUBROUTINE opa_model
46      !!----------------------------------------------------------------------
47      !!                     ***  ROUTINE opa  ***
48      !!
49      !! ** Purpose :   opa solves the primitive equations on an orthogonal
50      !!      curvilinear mesh on the sphere.
51      !!
52      !! ** Method  : - model general initialization
53      !!              - launch the time-stepping (stp routine)
54      !!
55      !! References :
56      !!      Madec, Delecluse,Imbard, and Levy, 1997: reference manual.
57      !!              internal report, IPSL.
58      !!
59      !! History :
60      !!   4.0  !  90-10  (C. Levy, G. Madec)  Original code
61      !!   7.0  !  91-11  (M. Imbard, C. Levy, G. Madec)
62      !!   7.1  !  93-03  (M. Imbard, C. Levy, G. Madec, O. Marti,
63      !!                   M. Guyon, A. Lazar, P. Delecluse, C. Perigaud,
64      !!                   G. Caniaux, B. Colot, C. Maes ) release 7.1
65      !!        !  92-06  (L.Terray) coupling implementation
66      !!        !  93-11  (M.A. Filiberti) IGLOO sea-ice
67      !!   8.0  !  96-03  (M. Imbard, C. Levy, G. Madec, O. Marti,
68      !!                   M. Guyon, A. Lazar, P. Delecluse, L.Terray,
69      !!                   M.A. Filiberti, J. Vialar, A.M. Treguier,
70      !!                   M. Levy)  release 8.0
71      !!   8.1  !  97-06  (M. Imbard, G. Madec)
72      !!   8.2  !  99-11  (M. Imbard, H. Goosse)  LIM sea-ice model
73      !!        !  99-12  (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols)  OPEN-MP
74      !!        !  00-07  (J-M Molines, M. Imbard)  Open Boundary Conditions  (CLIPPER)
75      !!   9.0  !  02-08  (G. Madec)  F90: Free form and modules
76      !!----------------------------------------------------------------------
77      !! * Local declarations
78      INTEGER ::   istp       ! time step index
79      CHARACTER (len=20) ::   namelistname
80      CHARACTER (len=28) ::   file_out
81      CHARACTER (len=64) ::        &
82         cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing
83
84      !!----------------------------------------------------------------------
85
86      ! Initializations
87      ! ===============
88
89      file_out = 'ocean.output'
90
91      ! open listing and namelist units
92      CALL ctlopn( numout, file_out, 'UNKNOWN', 'FORMATTED',   &
93         &         'SEQUENTIAL', 1, 6, .FALSE., 1 )
94
95      namelistname = 'namelist'
96      CALL ctlopn( numnam, namelistname, 'OLD', 'FORMATTED', 'SEQUENTIAL',   &
97         &         1, numout, .FALSE., 1 )
98
99      WRITE(numout,*)
100      WRITE(numout,*) '                 L O D Y C - I P S L'
101      WRITE(numout,*) '                     O P A model'
102      WRITE(numout,*) '            Ocean General Circulation Model'
103      WRITE(numout,*) '               version OPA 9.0  (2005) '
104      WRITE(numout,*)
105      WRITE(numout,*)
106
107      ! Nodes selection
108      narea = mynode()
109      narea = narea + 1    ! mynode return the rank of proc (0 --> jpnij -1 )
110      lwp   = narea == 1
111
112      ! open additionnal listing
113      IF( ln_ctl )   THEN
114         IF( narea-1 > 0 )   THEN
115            WRITE(file_out,FMT="('ocean.output_',I4.4)") narea-1
116            CALL ctlopn( numout, file_out, 'UNKNOWN', 'FORMATTED',   &
117               &         'SEQUENTIAL', 1, numout, .FALSE., 1 )
118            lwp = .TRUE.
119            !
120            WRITE(numout,*)
121            WRITE(numout,*) '                 L O D Y C - I P S L'
122            WRITE(numout,*) '                     O P A model'
123            WRITE(numout,*) '            Ocean General Circulation Model'
124            WRITE(numout,*) '               version OPA 9.0  (2005) '
125            WRITE(numout,*) '                   MPI Ocean output '
126            WRITE(numout,*)
127            WRITE(numout,*)
128         ENDIF
129      ENDIF
130
131      !                                     ! ============================== !
132      !                                     !  Model general initialization  !
133      !                                     ! ============================== !
134
135      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
136
137                                            ! Domain decomposition
138      IF( jpni * jpnj == jpnij ) THEN
139         CALL mpp_init                          ! standard cutting out
140      ELSE
141         CALL mpp_init2                         ! eliminate land processors
142      ENDIF
143     
144      CALL phy_cst                          ! Physical constants
145
146      CALL dom_cfg                          ! Domain configuration
147
148      CALL dom_init                         ! Domain
149
150      CALL istate_init                      ! ocean initial state (Dynamics and tracers)
151
152      CALL trc_ini                           ! Passive tracers
153
154      CALL day_init                          ! Calendar
155
156      CALL dta_dyn( nit000 )                 ! Initialization for the dynamics
157      !                                     ! Ocean physics
158      CALL tra_qsr_init                         ! Solar radiation penetration
159
160#if ! defined key_off_degrad
161      CALL ldf_tra_init                         ! Lateral ocean tracer physics
162#endif 
163      !                                     ! =============== !
164      !                                     !  time stepping  !
165      !                                     ! =============== !
166
167      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
168
169      istp = nit000
170      DO WHILE ( istp <= nitend .AND. nstop == 0 )
171         CALL stp( istp )
172         istp = istp + 1
173      END DO
174      !                                     ! ========= !
175      !                                     !  Job end  !
176      !                                     ! ========= !
177
178      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
179
180      IF( nstop /= 0 ) THEN                 ! error print
181      IF(lwp) WRITE(numout,cform_err)
182      IF(lwp) WRITE(numout,*) nstop, ' error have been found' 
183      ENDIF
184
185      IF( lk_mpp )   CALL mppstop                          ! Close all files (mpp)
186
187   END SUBROUTINE opa_model
188
189   !!======================================================================
190END MODULE opa
Note: See TracBrowser for help on using the repository browser.