@@ -30,10 +30,10 @@ program update_mpas_states
30
30
get_time, get_date, operator (/= )
31
31
use model_mod, only : static_init_model, &
32
32
get_model_size, &
33
- get_analysis_time
33
+ get_analysis_time, update_u_from_reconstruct
34
34
35
35
use state_structure_mod, only : get_num_variables, get_variable_name, &
36
- get_variable_size
36
+ get_variable_size, get_varid_from_varname
37
37
38
38
use netcdf_utilities_mod, only : nc_open_file_readonly, &
39
39
nc_open_file_readwrite, &
@@ -105,14 +105,33 @@ program update_mpas_states
105
105
106
106
allocate (variable(get_variable_size(1 , i)))
107
107
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
+
108
112
call nc_get_variable(ncAnlID, get_variable_name(1 ,i), variable)
109
113
call nc_put_variable(ncBckID, get_variable_name(1 ,i), variable)
110
114
111
115
deallocate (variable)
112
116
113
117
enddo varloop
114
118
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)
116
135
117
136
call print_date( model_time,' update_mpas_states:model date' )
118
137
call print_time( model_time,' update_mpas_states:model time' )
0 commit comments