GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: dyn3d_common/iniconst.F90 Lines: 22 27 81.5 %
Date: 2023-06-30 12:56:34 Branches: 2 6 33.3 %

Line Branch Exec Source
1
!
2
! $Id: iniconst.F90 2601 2016-07-24 09:51:55Z emillour $
3
!
4
2
SUBROUTINE iniconst
5
6
  USE control_mod
7
#ifdef CPP_IOIPSL
8
  use IOIPSL
9
#else
10
  ! if not using IOIPSL, we still need to use (a local version of) getin
11
  use ioipsl_getincom
12
#endif
13
  USE comconst_mod, ONLY: im, imp1, jm, jmp1, lllm, lllmm1, lllmp1, &
14
                          unsim, pi, r, kappa, cpp, dtvr, dtphys
15
  USE comvert_mod, ONLY: disvert_type, pressure_exner
16
17
  IMPLICIT NONE
18
  !
19
  !      P. Le Van
20
  !
21
  !   Declarations:
22
  !   -------------
23
  !
24
  include "dimensions.h"
25
  include "paramet.h"
26
  include "iniprint.h"
27
28
  character(len=*),parameter :: modname="iniconst"
29
  character(len=80) :: abort_message
30
  !
31
  !
32
  !
33
  !-----------------------------------------------------------------------
34
  !   dimension des boucles:
35
  !   ----------------------
36
37
1
  im      = iim
38
1
  jm      = jjm
39
1
  lllm    = llm
40
1
  imp1    = iim
41
1
  jmp1    = jjm + 1
42
1
  lllmm1  = llm - 1
43
1
  lllmp1  = llm + 1
44
45
  !-----------------------------------------------------------------------
46
47
1
  dtphys  = iphysiq * dtvr
48
1
  unsim   = 1./iim
49
1
  pi      = 2.*ASIN( 1. )
50
51
  !-----------------------------------------------------------------------
52
  !
53
54
1
  r       = cpp * kappa
55
56
1
  write(lunout,*) trim(modname),': R  CP  Kappa ',r,cpp,kappa
57
  !
58
  !-----------------------------------------------------------------------
59
60
  ! vertical discretization: default behavior depends on planet_type flag
61
1
  if (planet_type=="earth") then
62
1
     disvert_type=1
63
  else
64
     disvert_type=2
65
  endif
66
  ! but user can also specify using one or the other in run.def:
67
1
  call getin('disvert_type',disvert_type)
68
1
  write(lunout,*) trim(modname),': disvert_type=',disvert_type
69
70
1
  pressure_exner = disvert_type == 1 ! default value
71
1
  call getin('pressure_exner', pressure_exner)
72
73
1
  if (disvert_type==1) then
74
     ! standard case for Earth (automatic generation of levels)
75
1
     call disvert()
76
  else if (disvert_type==2) then
77
     ! standard case for planets (levels generated using z2sig.def file)
78
     call disvert_noterre
79
  else
80
     write(abort_message,*) "Wrong value for disvert_type: ", disvert_type
81
     call abort_gcm(modname,abort_message,0)
82
  endif
83
84
1
END SUBROUTINE iniconst