Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugs are fixed in 2 files: #249

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/shared/fms/fms_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2594,7 +2594,7 @@ subroutine save_default_restart(fileObj,restartpath)
character(len=336) :: restartpath ! The restart file path (dir/file).

character(len=8) :: suffix ! A suffix (like _2) that is appended to the name of files after the first.
integer :: var_sz, size_in_file ! The size in bytes of each variable and of the variables already in a file.
integer(LONG_KIND) :: var_sz, size_in_file ! The size in bytes of each variable and of the variables already in a file.
integer :: unit ! The mpp unit of the open file.
real, dimension(max_axis_size) :: axisdata
integer, dimension(max_axes) :: id_x_axes, siz_x_axes
Expand Down
56 changes: 32 additions & 24 deletions src/tools/fregrid/fregrid.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,12 @@ int main(int argc, char* argv[])
set_mosaic_data_file(ntiles_out, mosaic_out, dir_out, file2_out, output_file[1]);
}

for(n=0; n<ntiles_in; n++) file_in[n].fid = mpp_open(file_in[n].name, MPP_READ);
for(n=0; n<ntiles_in; n++){
file_in[n].fid = mpp_open(file_in[n].name, MPP_READ);
if(nfiles == 2) {
file2_in[n].fid = mpp_open(file2_in[n].name, MPP_READ);
}
}

set_field_struct ( ntiles_in, scalar_in, nscalar, scalar_name[0], file_in);
set_field_struct ( ntiles_out, scalar_out, nscalar, scalar_name[0], file_out);
Expand Down Expand Up @@ -808,10 +813,8 @@ int main(int argc, char* argv[])
else {
for(level_z=scalar_in->var[l].kstart; level_z <= scalar_in->var[l].kend; level_z++)
{
if(test_case)
get_test_input_data(test_case, test_param, ntiles_in, scalar_in, grid_in, bound_T, opcode);
else
get_input_data(ntiles_in, scalar_in, grid_in, bound_T, l, level_z, level_n, level_t, extrapolate, stop_crit);
if(test_case) get_test_input_data(test_case, test_param, ntiles_in, scalar_in, grid_in, bound_T, opcode);
else get_input_data(ntiles_in, scalar_in, grid_in, bound_T, l, level_z, level_n, level_t, extrapolate, stop_crit);
allocate_field_data(ntiles_out, scalar_out, grid_out, 1);
if( opcode & BILINEAR )
do_scalar_bilinear_interp(interp, l, ntiles_in, grid_in, grid_out, scalar_in, scalar_out, finer_step, fill_missing);
Expand All @@ -834,27 +837,32 @@ int main(int argc, char* argv[])

/* then interp vector field */
for(l=0; l<nvector; l++) {
if( !u_in[n].var[l].has_taxis && m>0) continue;
/*if( !u_in[n].var[l].has_taxis && m>0) continue;*/
if( !u_in->var[l].has_taxis && m>0) continue;
level_t = m + u_in->var[l].lstart;
get_input_data(ntiles_in, u_in, grid_in, bound_T, l, level_z, level_n, level_t, extrapolate, stop_crit);
get_input_data(ntiles_in, v_in, grid_in, bound_T, l, level_z, level_n, level_t, extrapolate, stop_crit);
allocate_field_data(ntiles_out, u_out, grid_out, u_in[n].var[l].nz);
allocate_field_data(ntiles_out, v_out, grid_out, u_in[n].var[l].nz);
if( opcode & BILINEAR )
do_vector_bilinear_interp(interp, l, ntiles_in, grid_in, ntiles_out, grid_out, u_in, v_in, u_out, v_out, finer_step, fill_missing);
else
do_vector_conserve_interp(interp, l, ntiles_in, grid_in, ntiles_out, grid_out, u_in, v_in, u_out, v_out, opcode);

write_field_data(ntiles_out, u_out, grid_out, l, level_z, level_n, m);
write_field_data(ntiles_out, v_out, grid_out, l, level_z, level_n, m);
for(n=0; n<ntiles_in; n++) {
free(u_in[n].data);
free(v_in[n].data);
for(level_n =0; level_n < u_in->var[l].nn; level_n++) {
for(level_z=u_in->var[l].kstart; level_z <= u_in->var[l].kend; level_z++){
get_input_data(ntiles_in, u_in, grid_in, bound_T, l, level_z, level_n, level_t, extrapolate, stop_crit);
get_input_data(ntiles_in, v_in, grid_in, bound_T, l, level_z, level_n, level_t, extrapolate, stop_crit);
allocate_field_data(ntiles_out, u_out, grid_out, u_in->var[l].nz);
allocate_field_data(ntiles_out, v_out, grid_out, u_in->var[l].nz);
if( opcode & BILINEAR )
do_vector_bilinear_interp(interp, l, ntiles_in, grid_in, ntiles_out, grid_out, u_in, v_in, u_out, v_out, finer_step, fill_missing);
else
do_vector_conserve_interp(interp, l, ntiles_in, grid_in, ntiles_out, grid_out, u_in, v_in, u_out, v_out, opcode);

write_field_data(ntiles_out, u_out, grid_out, l, level_z, level_n, m);
write_field_data(ntiles_out, v_out, grid_out, l, level_z, level_n, m);
for(n=0; n<ntiles_in; n++) {
free(u_in[n].data);
free(v_in[n].data);
}
for(n=0; n<ntiles_out; n++) {
free(u_out[n].data);
free(v_out[n].data);
}
}
}
for(n=0; n<ntiles_out; n++) {
free(u_out[n].data);
free(v_out[n].data);
}
}
}

Expand Down