118
119 use scale_file_h, only: &
120 file_hshort
121 use scale_prc, only: &
122 prc_masterrank, &
123 prc_myrank, &
124 prc_abort
125 use scale_time, only: &
126 time_nowdate, &
127 time_nowsubsec, &
128 time_startdaysec, &
129 time_dtsec, &
130 time_nowstep
131 use scale_calendar, only: &
132 calendar_get_name
133 implicit none
134
135 class(Meshbase1d), intent(in), target, optional :: mesh1D_
136 class(MeshRectDom2d), intent(in), target, optional :: mesh2D_
137 class(MeshCubeDom3D), intent(in), target, optional :: mesh3D_
138 class(MeshCubedSphereDom2D), intent(in), target, optional :: meshCubedsphere2D_
139 class(MeshCubedSphereDom3D), intent(in), target, optional :: meshCubedsphere3D_
140
141 character(len=H_MID) :: FILE_HISTORY_MESHFILED_H_TITLE = 'SCALE-FEM FILE_HISTORY_MESHFIELD'
142 character(len=H_MID) :: FILE_HISTORY_MESHFIELD_T_SINCE
143
144
145 character(len=FILE_HSHORT) :: calendar
146 real(DP) :: start_daysec
147
148
149 file_history_meshfield_startdate(:) = time_nowdate
150 file_history_meshfield_startsubsec = time_nowsubsec
151
152 start_daysec = time_startdaysec
153 if ( time_nowdate(1) > 0 ) then
154 write(file_history_meshfield_t_since,'(I4.4,5(A1,I2.2))') time_nowdate(1), &
155 '-', time_nowdate(2), &
156 '-', time_nowdate(3), &
157 ' ', time_nowdate(4), &
158 ':', time_nowdate(5), &
159 ':', time_nowdate(6)
160 start_daysec = time_nowsubsec
161 else
162 file_history_meshfield_t_since = ''
163 endif
164
165
166 call calendar_get_name( calendar )
167
168 call file_history_setup( file_history_meshfiled_h_title, &
169 h_source, h_institute, &
170 start_daysec, time_dtsec, &
171 time_since = file_history_meshfield_t_since, &
172 calendar = calendar, &
173 default_zcoord = 'model', &
174 myrank = prc_myrank )
175
176 call file_history_set_nowdate( time_nowdate, time_nowsubsec, time_nowstep )
177
178
179
180 nullify( mesh1d, mesh2d, mesh3d )
181 nullify( meshcubedsphere2d, meshcubedsphere3d )
182
183 if ( present(mesh1d_) ) then
184 mesh1d => mesh1d_
185 call set_dim_axis1d()
186 else if ( present(mesh2d_) ) then
187 mesh2d => mesh2d_
188 call set_dim_axis2d()
189 else if ( present(mesh3d_) ) then
190 mesh3d => mesh3d_
191 mesh2d => mesh3d%mesh2D
192 call set_dim_axis3d()
193 else if ( present(meshcubedsphere2d_) ) then
194 meshcubedsphere2d => meshcubedsphere2d_
195 call set_dim_axis2d_cubedsphere()
196 else if ( present(meshcubedsphere3d_) ) then
197 meshcubedsphere3d => meshcubedsphere3d_
198 meshcubedsphere2d => meshcubedsphere3d%mesh2D
199 call set_dim_axis3d_cubedsphere()
200 else
201 log_error("FILE_HISTORY_meshfield_setup",*) "Any mesh (mesh1d/2d/3d) are not specified."
202 call prc_abort
203 end if
204
205 file_history_filemeshfiled_disable = .false.
206
207 return