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

heterogenous standard deviation for perturbation input from file #628

Merged
merged 6 commits into from
Mar 8, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,9 @@ subroutine get_pert_grid( tile_grid, pert_grid )
else ! cubed-sphere grid
!for cubed-sphere grid, global lat_lon grid
N_x=tile_grid%n_lon

! NOTE: The pert grid specification is hard-wired here.
! If perturbation stddev is heterogeneous input from a file,
! then the input grid must match this hard-wired grid. (sqz 2/2023)
n_lon=4*N_x
n_lat=3*N_x
write(lattmp,'(I6.6)') n_lat
Expand Down Expand Up @@ -1111,6 +1113,8 @@ subroutine get_force_pert_inputs( pert_grid_l, &
call MPI_BCAST(stdfilename_force_pert,300,MPI_CHARACTER,0,mpicomm,mpierr)

nc4_file = stdfilename_force_pert
! NOTE: the input file is in netcdf, with a group 'std_force_pert',
! and the grid is same as the *global* grid (tile_grid_g) (sqz 2/2023)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saraqzhang, I'm a bit confused by this statement. In line 661 above, there's a comment that when the model is on the cube-sphere tile space, the pert grid is a hard-wired lat/lon grid (with approximately the same resolution). The comment here (lines 1116-1117) and again below (lines 1510-1511) suggest that the pert grid is always tile_grid_g. But for the cube-sphere tile space, this isn't correct. Maybe I'm misunderstanding this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tile_grid_g here is already a lat-lon grid generated here

call get_pert_grid(tile_grid_g, latlon_tmp_g)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment should be more clear: the grid in netcdf file is lat-lon grid, the resolution should match what "get_pert_grid(tile_grid_g, latlon_tmp_g) " generated.
it is left to user to find out what the resolution should be. ( for instance in a C180 run, it is 720x540)


! --compute-local-shape-first-
! ASSUMPTION: data in file are on the *global* grid (tile_grid_g)
Expand Down Expand Up @@ -1503,6 +1507,8 @@ subroutine get_progn_pert_inputs( pert_grid_l, &
call MPI_BCAST(stdfilename_progn_pert,300,MPI_CHARACTER,0,mpicomm,mpierr)

nc4_file = stdfilename_progn_pert
! NOTE: the input file is in netcdf, with a group 'std_progn_pert',
! and the grid is same as the *global* grid (tile_grid_g) (sqz 2/2023)

! --compute-local-shape-first-
! ASSUMPTION: data in file are on the *global* grid (tile_grid_g)
Expand Down Expand Up @@ -1549,10 +1555,10 @@ subroutine get_progn_pert_inputs( pert_grid_l, &
std_progn_pert(ivar,:,:) = 0.
end if
end do
! close file
nc4_stat = nf90_close(nc4_id)
if (nc4_stat /= nf90_noerr) call handle_nc4_stat(nc4_stat)
end if
! close file
nc4_stat = nf90_close(nc4_id)
if (nc4_stat /= nf90_noerr) call handle_nc4_stat(nc4_stat)
end do
call MPI_Barrier(mpicomm, mpierr)
end if
Expand Down