Skip to content

Commit 9954b92

Browse files
skipping u for update_mpas_states
update_u_from_reconstruct passing this namelist option publically. I am not sure why this is a model_mod option rather than an update_mpas_states option? To make people set it for filter? #753 (comment)
1 parent 4404e17 commit 9954b92

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

Diff for: models/mpas_atm/model_mod.f90

+2-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ module model_mod
162162
cell_ok_to_interpolate, &
163163
uv_cell_to_edges
164164

165-
public :: set_lbc_variables, &
165+
public :: update_u_from_reconstruct, &
166+
set_lbc_variables, &
166167
force_u_into_state, &
167168
statevector_to_boundary_file
168169

Diff for: models/mpas_atm/update_mpas_states.f90

+22-3
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ program update_mpas_states
3030
get_time, get_date, operator(/=)
3131
use model_mod, only : static_init_model, &
3232
get_model_size, &
33-
get_analysis_time
33+
get_analysis_time, update_u_from_reconstruct
3434

3535
use state_structure_mod, only : get_num_variables, get_variable_name, &
36-
get_variable_size
36+
get_variable_size, get_varid_from_varname
3737

3838
use netcdf_utilities_mod, only : nc_open_file_readonly, &
3939
nc_open_file_readwrite, &
@@ -105,14 +105,33 @@ program update_mpas_states
105105

106106
allocate(variable(get_variable_size(1, i)))
107107

108+
if (get_variable_name(1,i) == 'uReconstructZonal' .or. &
109+
get_variable_name(1,i) == 'uReconstructMeridional'.or. &
110+
get_variable_name(1,i) == 'u') cycle varloop
111+
108112
call nc_get_variable(ncAnlID, get_variable_name(1,i), variable)
109113
call nc_put_variable(ncBckID, get_variable_name(1,i), variable)
110114

111115
deallocate(variable)
112116

113117
enddo varloop
114118

115-
call error_handler(E_MSG, 'Overwriting states in ',trim(next_outfile), source)
119+
! deal with wind
120+
if (update_u_from_reconstruct) then
121+
! reconstruct u
122+
call error_handler(E_ERR,'update_mpas_states','update_u_from_reconstruct is not implemented',source)
123+
else
124+
! copy u from analysis to background
125+
allocate(variable(get_variable_size(1, get_varid_from_varname(1, 'u'))))
126+
127+
call nc_get_variable(ncAnlID, 'u', variable)
128+
call nc_put_variable(ncBckID, 'u', variable)
129+
130+
deallocate(variable)
131+
132+
endif
133+
134+
call error_handler(E_MSG, 'Overwritten states in ',trim(next_outfile), source)
116135

117136
call print_date( model_time,'update_mpas_states:model date')
118137
call print_time( model_time,'update_mpas_states:model time')

0 commit comments

Comments
 (0)