My Project
Functions/Subroutines
coords_n_const.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine coords_n_const
 

Function/Subroutine Documentation

◆ coords_n_const()

subroutine coords_n_const ( )

Definition at line 41 of file coords_n_const.f90.

41 
42  USE mod_input
43  USE mod_setup
44  IMPLICIT NONE
45  INTEGER STATUS, I
46 
47 !===============================================================================!
48 ! OPEN FILES
49 ! UNLESS OTHERWISE SPECIFED THE ROUTINES CALLED HERE ARE IN mod_input.F
50 !===============================================================================!
51 
52  SELECT CASE(startup_type)
53  !=================================================
54  ! HOTSTART
55  CASE("hotstart")
56  !=================================================
57  if(dbg_set(dbg_log)) then
58  WRITE(ipt,*)'! READING FILES FOR HOTSTART !'
59  WRITE(ipt,*)'! !'
60  end if
61 
62  ! ALLOCATE SPACE FOR THE LOCAL GRID DATA
63  ALLOCATE(y_lcl(0:mt),stat=status)
64  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE Y_LCL")
65  y_lcl=0.0_sp
66  ALLOCATE(x_lcl(0:mt),stat=status)
67  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE X_LCL")
68  x_lcl=0.0_sp
69  ALLOCATE(h_lcl(0:mt),stat=status)
70  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE H_LCL")
71  h_lcl=0.0_sp
72 
76 
77 
78  DEALLOCATE(x_lcl)
79  DEALLOCATE(y_lcl)
80 
81 
83  CALL setup_depth
84  DEALLOCATE(h_lcl) ! COULD BE LOADED DIRECTLY - MUST SET MAX/MIN
85 
86  CALL load_restart_coriolis(cor)! LOAD DIRECTLY
87 
88  !! ggao for equatoral min (4deg)
89 ! IF(.NOT. EQUATOR_BETA_PLANE)THEN
90 ! WHERE(COR < 1.e-5_SP .AND. COR > 0.0_SP) COR = 1.e-5_SP
91 ! WHERE(COR > -1.e-5_SP .AND. COR < 0.0_SP) COR = -1.e-5_SP
92 ! END IF
93 
94  CALL setup_gravity
95 
96  CALL load_restart_sponge(cc_sponge) ! LOAD DIRECTLY
97 
99  CALL load_restart_sigma(z,z1) ! LOAD DIRECTLY TO ALL_VARS:Z,Z1
101 
102  CALL setup_obctypes
103 
105 
107 
108  !=================================================
109  ! CRASHSTART
110  CASE("crashrestart")
111  !=================================================
112  if(dbg_set(dbg_log)) then
113  WRITE(ipt,*)'! READING FILES FOR CRASHRESTART !'
114  WRITE(ipt,*)'! !'
115  end if
116  ! ALLOCATE SPACE FOR THE LOCAL GRID DATA
117  ALLOCATE(y_lcl(0:mt),stat=status)
118  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE Y_LCL")
119  y_lcl=0.0_sp
120  ALLOCATE(x_lcl(0:mt),stat=status)
121  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE X_LCL")
122  x_lcl=0.0_sp
123  ALLOCATE(h_lcl(0:mt),stat=status)
124  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE H_LCL")
125  h_lcl=0.0_sp
126 
127 
131 
132 
133  DEALLOCATE(x_lcl)
134  DEALLOCATE(y_lcl)
135 
136 
138  CALL setup_depth
139  DEALLOCATE(h_lcl) ! COULD BE LOADED DIRECTLY - MUST SET MAX/MIN
140 
142 
143  CALL setup_gravity
144 
145  CALL load_restart_sponge(cc_sponge) ! LOAD DIRECTLY TO ALL_VARS:CC_SPONGE
146 
147 
149  CALL load_restart_sigma(z,z1) ! LOAD DIRECTLY TO ALL_VARS:Z,Z1
151 
152  CALL setup_obctypes
153 
155 
157 
158  !=================================================
159  ! COLDSTART
160  CASE("coldstart")
161  !=================================================
162  if(dbg_set(dbg_log)) then
163  WRITE(ipt,*)'! READING FILES FOR COLDSTART !'
164  WRITE(ipt,*)'! !'
165  end if
166 
167  IF(msr) THEN
168  ! ALLOCATE SPACE FOR THE GLOBAL GRID DATA
169  ALLOCATE(y_gbl(0:mgl),stat=status)
170  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE Y_GBL")
171  y_gbl=0.0_sp
172  ALLOCATE(x_gbl(0:mgl),stat=status)
173  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE X_GBL")
174  x_gbl=0.0_sp
175  END IF
176 
177  ! ALLOCATE SPACE FOR THE LOCAL GRID DATA
178  ALLOCATE(y_lcl(0:mt),stat=status)
179  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE Y_LCL")
180  y_lcl=0.0_sp
181  ALLOCATE(x_lcl(0:mt),stat=status)
182  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE X_LCL")
183  x_lcl=0.0_sp
184 
185  ALLOCATE(h_lcl(0:mt),stat=status)
186  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE H_LCL")
187  h_lcl=0.0_sp
188 
189  ALLOCATE(c_lcl(0:mt),stat=status)
190  IF (status /=0 ) CALL fatal_error("COULD NOT ALLOCATE C_LCL")
191  c_lcl=0.0_sp
192 
193 
197 
198 
199  DEALLOCATE(x_lcl)
200  DEALLOCATE(y_lcl)
201 
203  CALL setup_depth
204 
205  DEALLOCATE(h_lcl)
206 
208  CALL setup_coriolis
209 
210  DEALLOCATE(c_lcl)
211 
212  CALL setup_gravity
213 
214  ! THESE VARIABLES ARE NOT ALLOCATED YET
216  CALL setup_sponge
217 
218 
219 ! CALL LOAD_COLDSTART_SIGMA
220  CALL setup_sigma
222 
223  IF(msr) THEN
224  DEALLOCATE(x_gbl)
225  DEALLOCATE(y_gbl)
226  END IF
227 
228  CALL setup_obctypes
229 
231 
233 
234  END SELECT
235 
236 
subroutine coordinate_units(XL, YL)
Definition: mod_setup.f90:300
real(sp), dimension(:), allocatable, target cor
Definition: mod_main.f90:1113
real(sp), dimension(:), allocatable, target x_gbl
Definition: mod_setup.f90:54
logical msr
Definition: mod_main.f90:101
integer mt
Definition: mod_main.f90:78
subroutine setup_center_coords
Definition: mod_setup.f90:74
subroutine load_coldstart_coriolis(X_GBL, Y_GBL, C_LCL)
Definition: mod_input.f90:2496
logical function dbg_set(vrb)
Definition: mod_utils.f90:182
character(len=80) startup_type
Definition: mod_main.f90:141
real(sp), dimension(:), allocatable, target h_lcl
Definition: mod_setup.f90:61
integer nsponge
Definition: mod_setup.f90:66
real(sp), dimension(:), allocatable, target x_lcl
Definition: mod_setup.f90:55
subroutine load_restart_coriolis(C_LCL)
Definition: mod_input.f90:2318
real(sp), dimension(:), allocatable, target c_spg
Definition: mod_setup.f90:65
subroutine load_restart_sigma(Z, Z1)
Definition: mod_input.f90:2351
subroutine load_restart_sponge(SPG)
Definition: mod_input.f90:2334
real(sp), dimension(:), allocatable, target r_spg
Definition: mod_setup.f90:65
real(sp), dimension(:), allocatable, target y_spg
Definition: mod_setup.f90:65
subroutine setup_bottom_roughness
Definition: mod_setup.f90:166
subroutine setup_coriolis
Definition: mod_setup.f90:214
subroutine load_restart_coords(X_LCL, Y_LCL)
Definition: mod_input.f90:2246
subroutine setup_sponge
Definition: mod_setup.f90:257
real(sp), dimension(:), allocatable, target x_spg
Definition: mod_setup.f90:65
subroutine load_restart_depth(H_LCL)
Definition: mod_input.f90:2302
real(sp), dimension(:), allocatable, target c_lcl
Definition: mod_setup.f90:58
integer, dimension(:), allocatable, target n_spg
Definition: mod_setup.f90:64
subroutine setup_depth
Definition: mod_setup.f90:195
real(sp), dimension(:), allocatable, target y_lcl
Definition: mod_setup.f90:55
integer mgl
Definition: mod_main.f90:50
subroutine setup_gravity
Definition: mod_setup.f90:241
real(sp), dimension(:,:), allocatable, target z
Definition: mod_main.f90:1090
subroutine fatal_error(ER1, ER2, ER3, ER4)
Definition: mod_utils.f90:230
real(sp), dimension(:), allocatable, target y_gbl
Definition: mod_setup.f90:54
subroutine load_coldstart_sponge(X_GBL, Y_GBL, NSPONGE, N_SPG, R_SPG, C_SPG, X_SPG, Y_SPG)
Definition: mod_input.f90:2528
real(sp), dimension(:,:), allocatable, target z1
Definition: mod_main.f90:1094
subroutine load_coldstart_coords(X_GBL, Y_GBL, X_LCL, Y_LCL)
Definition: mod_input.f90:2444
real(sp), dimension(:), allocatable, target cc_sponge
Definition: mod_main.f90:1127
character(len=80), parameter stype_restart
Definition: mod_main.f90:898
subroutine setup_obctypes
Definition: mod_obcs.f90:478
integer ipt
Definition: mod_main.f90:922
subroutine setup_sigma
Definition: mod_setup.f90:403
subroutine load_coldstart_depth(X_GBL, Y_GBL, H_LCL)
Definition: mod_input.f90:2469
subroutine setup_horizontal_mixing_coefficient
Definition: mod_setup.f90:134
character(len=80) stype
Definition: mod_main.f90:893
subroutine setup_sigma_derivatives
Definition: mod_setup.f90:636
integer, parameter dbg_log
Definition: mod_utils.f90:65
Here is the call graph for this function:
Here is the caller graph for this function: