- Timestamp:
- 2010-11-25T15:44:47+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/module_example
r2281 r2433 7 7 !! History : 3.0 ! 2008-06 (Author Names) Original code 8 8 !! - ! 2008-08 (Author names) brief description of modifications 9 !! 3. 1 ! 2008-12(Author names) - -9 !! 3.3 ! 2010-11 (Author names) - - 10 10 !!---------------------------------------------------------------------- 11 12 11 #if defined key_example 13 12 !!---------------------------------------------------------------------- … … 26 25 PUBLIC exa_mpl ! routine called in xxx.F90 module 27 26 27 TYPE :: FLD_E !: Structure type definition 28 CHARACTER(len = 256) :: clname ! clname description 29 INTEGER :: nfreqh ! nfreqh description 30 END TYPE FLD_E 31 28 32 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: var1 !: var1 description. CAUTION always use !: to describe 29 33 ! ! a PUBLIC variable: simplify its search : … … 32 36 ! ! DO NOT use continuation lines in declaration 33 37 34 ! !!! ** namelist nam_xxx ** 35 LOGICAL :: ln_opt = 1 ! give the default value of each namelist parameter 36 CHARACTER:: cn_tex = 'T' ! short description of the variable 37 INTEGER :: nn_opt = 1 ! please respect the DOCTOR norm for namelist variable 38 REAL(wp) :: rn_var = 2._wp ! (it becomes easy to identify them in the code) 38 ! !!* namelist nam_xxx * 39 LOGICAL :: ln_opt = .TRUE. ! give the default value of each namelist parameter 40 CHARACTER :: cn_tex = 'T' ! short description of the variable 41 INTEGER :: nn_opt = 1 ! please respect the DOCTOR norm for namelist variable 42 REAL(wp) :: rn_var = 2._wp ! (it becomes easy to identify them in the code) 43 TYPE(FLD) :: sn_ex ! structure 39 44 40 45 INTEGER :: nint ! nint description (local permanent variable) … … 45 50 # include "exampl_substitute.h90" 46 51 !!---------------------------------------------------------------------- 47 !! NEMO/OPA 3. 0 , LOCEAN-IPSL (2008)52 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 48 53 !! $Id$ 49 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)54 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 50 55 !!---------------------------------------------------------------------- 51 52 56 CONTAINS 53 57 … … 111 115 ! 112 116 END SELECT 113 114 CALL mpplnk2( avmu, 'U', 1. ) ! Lateral boundary conditions ( avmu) (unchanged sign)117 ! 118 CALL mpplnk2( avmu, 'U', 1. ) ! Lateral boundary conditions (unchanged sign) 115 119 ! 116 120 END SUBROUTINE exa_mpl … … 131 135 INTEGER :: ji, jj, jk, jit ! dummy loop indices 132 136 !! 133 NAMELIST/namexa/ exa_v1, exa_v2, nexa_0 137 NAMELIST/namexa/ exa_v1, exa_v2, nexa_0, sn_ex 134 138 !!---------------------------------------------------------------------- 135 139 ! 136 REWIND ( numnam ) ! Read Namelist namexa : example parameters137 READ ( numnam, namexa )140 sn_ex%clname ='toto' ! set default namelist values 141 sn_ex%nfreqh = 2 138 142 ! 139 IF(lwp) THEN ! Control print 143 REWIND( numnam ) ! Read Namelist namexa : example parameters 144 READ ( numnam, namexa ) 145 ! 146 IF(lwp) THEN ! Control print 140 147 WRITE(numout,*) 141 148 WRITE(numout,*) 'exa_mpl_init : example ' 142 149 WRITE(numout,*) '~~~~~~~~~~~~' 143 WRITE(numout,*) ' Namelist namexa : set example parameters' 144 WRITE(numout,*) ' brief desciption exa_v1 = ', exa_v1 145 WRITE(numout,*) ' brief desciption exa_v1 = ', exa_v1 146 WRITE(numout,*) ' brief desciption nexa_0 = ', nexa_0 150 WRITE(numout,*) ' Namelist namexa : set example parameters' 151 WRITE(numout,*) ' brief desciption exa_v1 = ', exa_v1 152 WRITE(numout,*) ' brief desciption exa_v1 = ', exa_v1 153 WRITE(numout,*) ' brief desciption nexa_0 = ', nexa_0 154 WRITE(numout,*) ' brief desciption sn_ex%clname = ', sn_ex%clname 155 WRITE(numout,*) ' brief desciption sn_ex%nfreqh = ', sn_ex%nfreqh 147 156 ENDIF 148 157 ! 149 158 ! ! Parameter control 150 IF( ln_opt ) CALL ctl_stop( 'this work and option xxx are incompatible' ) 151 IF( ln_opt2 ) CALL ctl_warn( 'this work and option yyy may cause problems' ) 152 ENDIF 159 IF( ln_opt ) CALL ctl_stop( 'exa_mpl_init: this work and option xxx are incompatible' ) 160 IF( nn_opt == 2 ) CALL ctl_warn( 'exa_mpl_init: this work and option yyy may cause problems' ) 153 161 ! 154 162 END SUBROUTINE exa_mpl_init
Note: See TracChangeset
for help on using the changeset viewer.