Skip to content

Commit

Permalink
skipping u for update_mpas_states
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
hkershaw-brown committed Dec 26, 2024
1 parent 4404e17 commit 9954b92
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
3 changes: 2 additions & 1 deletion models/mpas_atm/model_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ module model_mod
cell_ok_to_interpolate, &
uv_cell_to_edges

public :: set_lbc_variables, &
public :: update_u_from_reconstruct, &
set_lbc_variables, &
force_u_into_state, &
statevector_to_boundary_file

Expand Down
25 changes: 22 additions & 3 deletions models/mpas_atm/update_mpas_states.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ program update_mpas_states
get_time, get_date, operator(/=)
use model_mod, only : static_init_model, &
get_model_size, &
get_analysis_time
get_analysis_time, update_u_from_reconstruct

use state_structure_mod, only : get_num_variables, get_variable_name, &
get_variable_size
get_variable_size, get_varid_from_varname

use netcdf_utilities_mod, only : nc_open_file_readonly, &
nc_open_file_readwrite, &
Expand Down Expand Up @@ -105,14 +105,33 @@ program update_mpas_states

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

if (get_variable_name(1,i) == 'uReconstructZonal' .or. &
get_variable_name(1,i) == 'uReconstructMeridional'.or. &
get_variable_name(1,i) == 'u') cycle varloop

call nc_get_variable(ncAnlID, get_variable_name(1,i), variable)
call nc_put_variable(ncBckID, get_variable_name(1,i), variable)

deallocate(variable)

enddo varloop

call error_handler(E_MSG, 'Overwriting states in ',trim(next_outfile), source)
! deal with wind
if (update_u_from_reconstruct) then
! reconstruct u
call error_handler(E_ERR,'update_mpas_states','update_u_from_reconstruct is not implemented',source)
else
! copy u from analysis to background
allocate(variable(get_variable_size(1, get_varid_from_varname(1, 'u'))))

call nc_get_variable(ncAnlID, 'u', variable)
call nc_put_variable(ncBckID, 'u', variable)

deallocate(variable)

endif

call error_handler(E_MSG, 'Overwritten states in ',trim(next_outfile), source)

call print_date( model_time,'update_mpas_states:model date')
call print_time( model_time,'update_mpas_states:model time')
Expand Down

0 comments on commit 9954b92

Please sign in to comment.