cpld_gridgen  1.13.0
 All Data Structures Files Functions Variables Pages
gen_fixgrid.F90
Go to the documentation of this file.
1 
5 
16 program gen_fixgrid
17 
18  use esmf
19 
20  use grdvars
21  use inputnml
22  use gengrid_kinds, only: cl, cs, dbl_kind, real_kind, int_kind
23  use angles, only: find_angq, find_ang
25  use mapped_mask, only: make_frac_land
26  use postwgts, only: make_postwgts
28  use cicegrid, only: write_cicegrid
29  use scripgrid, only: write_scripgrid
31  use charstrings, only: logmsg, res, dirsrc, dirout, atmres, fv3dir, editsfile
32  use charstrings, only: maskfile, maskname, topofile, toponame, editsfile, staggerlocs, cdate, history
34  use netcdf
35 
36  implicit none
37 
38  ! local variables
39  real(dbl_kind) :: dxt, dyt
40 
41  real(kind=dbl_kind), parameter :: pi = 3.14159265358979323846_dbl_kind
42  real(kind=dbl_kind), parameter :: deg2rad = pi/180.0_dbl_kind
43 
44  real(real_kind), allocatable, dimension(:,:) :: ww3dpth
45  integer(int_kind), allocatable, dimension(:,:) :: ww3mask
46 
47  character(len=CL) :: fsrc, fdst, fwgt
48  character(len= 2) :: cstagger
49 
50  integer :: rc,ncid,id,xtype
51  integer :: i,j,k,i2,j2
52  integer :: ii,jj
53  integer :: localpet, npet
54  logical :: fexist = .false.
55 
56  type(esmf_regridmethod_flag) :: method
57  type(esmf_vm) :: vm
58 
59  !WW3 file format for mod_def generation
60  character(len= 6) :: i4fmt = '(i4.4)'
61  character(len=CS) :: form1
62  character(len=CS) :: form2
63  character(len= 6) :: cnx
64 
65  !-------------------------------------------------------------------------
66  ! Initialize esmf environment.
67  !-------------------------------------------------------------------------
68 
69  call esmf_vmgetglobal(vm, rc=rc)
70  call esmf_initialize(vm=vm, logkindflag=esmf_logkind_multi, rc=rc)
71  call esmf_vmget(vm, localpet=localpet, pecount=npet, rc=rc)
72  if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
73  line=__line__, file=__file__)) call esmf_finalize(endflag=esmf_end_abort)
74  roottask = .false.
75  if (localpet == 0) roottask =.true.
76  if (npet /= 1) then
77  print *,npet,' More than one task specified; Aborting '
78  call esmf_finalize(endflag=esmf_end_abort)
79  end if
80 
81  !---------------------------------------------------------------------
82  !
83  !---------------------------------------------------------------------
84 
85  call read_inputnml('grid.nml')
86 
87  print '(a,2i6)',' output grid requested ',ni,nj
88  print '(a,2i6)',' supergrid size used ', nx,ny
89  print '(a)',' output grid tag '//trim(res)
90  print '(a)',' supergrid source directory '//trim(dirsrc)
91  print '(a)',' output grid directory '//trim(dirout)
92  print '(a)',' atm resolution '//trim(atmres)
93  print '(a,i6)',' fv3 tile grid size ',npx
94  print '(a)',' atm mosaic directory '//trim(fv3dir)
95  print '(a)',' MOM6 topography file '//trim(topofile)
96  print '(a)',' MOM6 edits file '//trim(editsfile)
97  print *,'editmask flag ',editmask
98  print *,'debug flag ',debug
99  print *,'do_postwgts flag ',do_postwgts
100  print *
101 
102  call allocate_all
103 
104  call esmf_logwrite("Starting gen_fixgrid", esmf_logmsg_info)
105  !---------------------------------------------------------------------
106  ! set up the arrays to retrieve the vertices
107  !---------------------------------------------------------------------
108 
109  ivertcu = ivertct + 1; jvertcu = jvertct + 0
110  ivertcv = ivertct + 0; jvertcv = jvertct + 1
111  ivertbu = ivertct + 1; jvertbu = jvertct + 1
112 
113  print '(a8,4i6)','iVertCt ',(ivertct(i),i=1,4)
114  print '(a8,4i6)','jVertCt ',(jvertct(i),i=1,4)
115  print *
116  print '(a8,4i6)','iVertCu ',(ivertcu(i),i=1,4)
117  print '(a8,4i6)','jVertCu ',(jvertcu(i),i=1,4)
118  print *
119  print '(a8,4i6)','iVertCv ',(ivertcv(i),i=1,4)
120  print '(a8,4i6)','jVertCv ',(jvertcv(i),i=1,4)
121  print *
122  print '(a8,4i6)','iVertBu ',(ivertbu(i),i=1,4)
123  print '(a8,4i6)','jVertBu ',(jvertbu(i),i=1,4)
124  print *
125 
126  latct_vert = -9999.0 ; lonct_vert = -9999.0
127  latcu_vert = -9999.0 ; loncu_vert = -9999.0
128  latcv_vert = -9999.0 ; loncv_vert = -9999.0
129  latbu_vert = -9999.0 ; lonbu_vert = -9999.0
130 
131  !---------------------------------------------------------------------
132  ! read the MOM6 land mask
133  !---------------------------------------------------------------------
134 
135  fsrc = trim(dirsrc)//'/'//trim(maskfile)
136 
137  rc = nf90_open(fsrc, nf90_nowrite, ncid)
138  print '(a)', 'reading ocean mask from '//trim(fsrc)
139  if(rc .ne. 0)print '(a)', 'nf90_open = '//trim(nf90_strerror(rc))
140 
141  wet4 = 0.0; wet8 = 0.0
142  rc = nf90_inq_varid(ncid, trim(maskname), id)
143  rc = nf90_inquire_variable(ncid, id, xtype=xtype)
144  if(xtype .eq. 5)rc = nf90_get_var(ncid, id, wet4)
145  if(xtype .eq. 6)rc = nf90_get_var(ncid, id, wet8)
146  rc = nf90_close(ncid)
147 
148  if(xtype.eq. 6)wet4 = real(wet8,4)
149 
150  !print *,minval(wet8),maxval(wet8)
151  !print *,minval(wet4),maxval(wet4)
152 
153  !---------------------------------------------------------------------
154  ! read the MOM6 depth file
155  !---------------------------------------------------------------------
156 
157  fsrc = trim(dirsrc)//'/'//trim(topofile)
158 
159  rc = nf90_open(fsrc, nf90_nowrite, ncid)
160  print '(a)', 'reading ocean topography from '//trim(fsrc)
161  if(rc .ne. 0)print '(a)', 'nf90_open = '//trim(nf90_strerror(rc))
162 
163  dp4 = 0.0; dp8 = 0.0
164  rc = nf90_inq_varid(ncid, trim(toponame), id)
165  rc = nf90_inquire_variable(ncid, id, xtype=xtype)
166  if(xtype .eq. 5)rc = nf90_get_var(ncid, id, dp4)
167  if(xtype .eq. 6)rc = nf90_get_var(ncid, id, dp8)
168  rc = nf90_close(ncid)
169 
170  if(xtype.eq. 6)dp4 = real(dp8,4)
171 
172  if(editmask)then
173  !---------------------------------------------------------------------
174  ! apply topoedits run time mask changes if required for this config
175  ! this will create a modified topoedits file which accounts for any
176  ! land mask changes created at run time by MOM6
177  !---------------------------------------------------------------------
178 
179  if(trim(editsfile) == 'none')then
180  print '(a)', 'Need a valid editsfile to make mask edits '
181  call abort()
182  end if
183  inquire(file=trim(dirsrc)//'/'//trim(editsfile),exist=fexist)
184  if (.not. fexist) then
185  print '(a)', 'Required topoedits file '//trim(editsfile) &
186  //'for land mask changes is missing '
187  call abort()
188  end if
189 
190  fsrc = trim(dirsrc)//'/'//trim(editsfile)
191  fdst = trim(dirout)//'/'//'ufs.'//trim(editsfile)
192  call add_topoedits(fsrc,fdst)
193  endif
194 
195  !---------------------------------------------------------------------
196  ! MOM6 reads the depth file, applies the topo edits and then adjusts
197  ! depth using masking_depth and min/max depth. This call mimics
198  ! MOM6 routines apply_topography_edits_from_file and limit_topography
199  ! If the the topoedits file has been modified to account for MOM6 run
200  ! time land mask changes (above), then the depth will be created using
201  ! this modified topoedits file
202  !---------------------------------------------------------------------
203 
204  fsrc = trim(dirsrc)//'/'//trim(editsfile)
205  if(editmask)fsrc = trim(dirout)//'/'//'ufs.'//trim(editsfile)
206 
207  if (trim(editsfile) /= 'none') then
208  inquire(file=trim(fsrc),exist=fexist)
209  if (.not. fexist) then
210  print '(a)', 'Required topoedits file '//trim(fsrc)//' is missing '
211  call abort()
212  end if
213  end if
214  call apply_topoedits(fsrc)
215 
216  !---------------------------------------------------------------------
217  ! read MOM6 supergrid file
218  !---------------------------------------------------------------------
219 
220  fsrc = trim(dirsrc)//'/'//'ocean_hgrid.nc'
221 
222  rc = nf90_open(fsrc, nf90_nowrite, ncid)
223  print '(a)', 'reading supergrid from '//trim(fsrc)
224  if(rc .ne. 0)print '(a)', 'nf90_open = '//trim(nf90_strerror(rc))
225 
226  rc = nf90_inq_varid(ncid, 'x', id) !lon
227  rc = nf90_get_var(ncid, id, x)
228 
229  rc = nf90_inq_varid(ncid, 'y', id) !lat
230  rc = nf90_get_var(ncid, id, y)
231 
232  rc = nf90_inq_varid(ncid, 'dx', id)
233  rc = nf90_get_var(ncid, id, dx)
234 
235  rc = nf90_inq_varid(ncid, 'dy', id)
236  rc = nf90_get_var(ncid, id, dy)
237 
238  rc = nf90_close(ncid)
239  !print *,'super grid size ',size(y,1),size(y,2)
240  !print *,'max lat in super grid ',maxval(y)
241  sg_maxlat = maxval(y)
242 
243  !---------------------------------------------------------------------
244  ! find the angle on corners---this requires the supergrid
245  !---------------------------------------------------------------------
246 
247  call find_angq
248 
249  !---------------------------------------------------------------------
250  ! fill grid variables
251  !---------------------------------------------------------------------
252 
253  do j = 1,nj
254  do i = 1,ni
255  i2 = 2*i ; j2 = 2*j
256  !deg->rad
257  ulon(i,j) = x(i2,j2)*deg2rad
258  ulat(i,j) = y(i2,j2)*deg2rad
259  !in rad already
260  angle(i,j) = -angq(i2,j2)
261  !m->cm
262  htn(i,j) = (dx(i2-1,j2) + dx(i2,j2))*100._dbl_kind
263  hte(i,j) = (dy(i2,j2-1) + dy(i2,j2))*100._dbl_kind
264  !deg
265  lonbu(i,j) = x(i2,j2)
266  latbu(i,j) = y(i2,j2)
267  !deg
268  lonct(i,j) = x(i2-1,j2-1)
269  loncu(i,j) = x(i2, j2-1)
270  loncv(i,j) = x(i2-1,j2 )
271  !deg
272  latct(i,j) = y(i2-1,j2-1)
273  latcu(i,j) = y(i2, j2-1)
274  latcv(i,j) = y(i2-1,j2 )
275  !m2
276  dxt = dx(i2-1,j2-1) + dx(i2,j2-1)
277  dyt = dy(i2-1,j2-1) + dy(i2-1,j2)
278  areact(i,j) = dxt*dyt
279  enddo
280  enddo
281 
282  !---------------------------------------------------------------------
283  ! find the angle on centers---this does not requires the supergrid
284  !---------------------------------------------------------------------
285 
286  call find_ang
287  print *,'ANGLET ',minval(anglet),maxval(anglet)
288  print *,'ANGLE ',minval(angle),maxval(angle)
289 
290  !---------------------------------------------------------------------
291  ! For the 1/4deg grid, hte at j=720 and j = 1440 is identically=0.0 for
292  ! j > 840 (64.0N). These are land points, but since CICE uses hte to
293  ! generate remaining variables, setting them to zero will cause problems
294  ! For 1deg grid, hte at ni/2 and ni are very small O~10-12, so test for
295  ! hte < 1.0
296  !---------------------------------------------------------------------
297 
298  write(logmsg,'(a,2e12.5)')'min vals of hte at folds ', &
299  minval(hte(ni/2,:)),minval(hte(ni,:))
300  print '(a)',trim(logmsg)
301  do j = 1,nj
302  ii = ni/2
303  if(hte(ii,j) .le. 1.0)hte(ii,j) = 0.5*(hte(ii-1,j) + hte(ii+1,j))
304  ii = ni
305  if(hte(ii,j) .le. 1.0)hte(ii,j) = 0.5*(hte(ii-1,j) + hte( 1,j))
306  enddo
307  write(logmsg,'(a,2e12.5)')'min vals of hte at folds ', &
308  minval(hte(ni/2,:)),minval(hte(ni,:))
309  print '(a)',trim(logmsg)
310 
311  !---------------------------------------------------------------------
312  !
313  !---------------------------------------------------------------------
314 
315  where(lonct .lt. 0.0)lonct = lonct + 360._dbl_kind
316  where(loncu .lt. 0.0)loncu = loncu + 360._dbl_kind
317  where(loncv .lt. 0.0)loncv = loncv + 360._dbl_kind
318  where(lonbu .lt. 0.0)lonbu = lonbu + 360._dbl_kind
319 
320  !---------------------------------------------------------------------
321  ! some basic error checking
322  ! find the i-th index of the poles at j= nj
323  ! the corner points must lie on the pole
324  !---------------------------------------------------------------------
325 
326  ipole = -1
327  j = nj
328  do i = 1,ni/2
329  if(latbu(i,j) .eq. sg_maxlat)ipole(1) = i
330  enddo
331  do i = ni/2+1,ni
332  if(latbu(i,j) .eq. sg_maxlat)ipole(2) = i
333  enddo
334  write(logmsg,'(a,2i6,2f12.2)')'poles found at i = ',ipole,latbu(ipole(1),nj), &
335  latbu(ipole(2),nj)
336  print '(a)',trim(logmsg)
337 
338  if(debug)call checkseam
339 
340  do i = 1,ni
341  i2 = ipole(2)+(ipole(1)-i)+1
342  xlonct(i) = lonct(i2,nj)
343  xlatct(i) = latct(i2,nj)
344  enddo
345 
346  do i = 1,ni
347  i2 = ipole(2)+(ipole(1)-i)
348  if(i2 .lt. 1)i2 = ni
349  xloncu(i) = loncu(i2,nj)
350  xlatcu(i) = latcu(i2,nj)
351  enddo
352 
353  if(debug)call checkxlatlon
354 
355  !approx lat at grid bottom
356  do i = 1,ni
357  dlatbu(i) = latbu(i,1) + 2.0*(latcu(i,1) - latbu(i,1))
358  dlatcv(i) = latct(i,1) + 2.0*(latct(i,1) - latcv(i,1))
359  enddo
360 
361  !---------------------------------------------------------------------
362  ! fill grid vertices variables
363  !---------------------------------------------------------------------
364 
365  !Ct and Cu grids align in j
366  call fill_vertices(2,nj , ivertct,jvertct, latbu,lonbu, latct_vert,lonct_vert)
367  call fill_bottom(ivertct,jvertct, latbu,lonbu, latct_vert,lonct_vert,dlatbu)
368 
369  call fill_vertices(2,nj , ivertcu,jvertcu, latcv,loncv, latcu_vert,loncu_vert)
370  call fill_bottom(ivertcu,jvertcu, latcv,loncv, latcu_vert,loncu_vert,dlatcv)
371 
372  !Cv and Bu grids align in j
373  call fill_vertices(1,nj-1, ivertcv,jvertcv, latcu,loncu, latcv_vert,loncv_vert)
374  call fill_top(ivertcv,jvertcv, latcu,loncu, latcv_vert,loncv_vert, xlatcu, xloncu)
375 
376  call fill_vertices(1,nj-1, ivertbu,jvertbu, latct,lonct, latbu_vert,lonbu_vert)
377  call fill_top(ivertbu,jvertbu, latct,lonct, latbu_vert,lonbu_vert, xlatct, xlonct)
378 
379  if(debug)call checkpoint
380 
381  if(minval(latct_vert) .lt. -1.e3)stop
382  if(minval(lonct_vert) .lt. -1.e3)stop
383  if(minval(latcu_vert) .lt. -1.e3)stop
384  if(minval(loncu_vert) .lt. -1.e3)stop
385  if(minval(latcv_vert) .lt. -1.e3)stop
386  if(minval(loncv_vert) .lt. -1.e3)stop
387  if(minval(latbu_vert) .lt. -1.e3)stop
388  if(minval(lonbu_vert) .lt. -1.e3)stop
389  deallocate(xlonct, xlatct, xloncu, xlatcu, dlatbu, dlatcv)
390 
391  !---------------------------------------------------------------------
392  ! write out grid file files
393  !---------------------------------------------------------------------
394 
395  ! create a history attribute
396  call date_and_time(date=cdate)
397  history = 'created on '//trim(cdate)//' from '//trim(fsrc)
398 
399  ! write fix grid
400  fdst = trim(dirout)//'/'//'tripole.mx'//trim(res)//'.nc'
401  call write_tripolegrid(trim(fdst))
402 
403  ! write cice grid
404  fdst = trim(dirout)//'/'//'grid_cice_NEMS_mx'//trim(res)//'.nc'
405  call write_cicegrid(trim(fdst))
406  deallocate(ulon, ulat, htn, hte)
407  ! write scrip grids; only the Ct is required, the remaining
408  ! staggers are used only in the postweights generation
409  do k = 1,nv
410  cstagger = trim(staggerlocs(k))
411  fdst = trim(dirout)//'/'//trim(cstagger)//'.mx'//trim(res)//'_SCRIP.nc'
412  logmsg = 'creating SCRIP file '//trim(fdst)
413  print '(a)',trim(logmsg)
414  call write_scripgrid(trim(fdst),trim(cstagger))
415  end do
416  deallocate(latcv_vert, loncv_vert)
417  deallocate(latcu_vert, loncu_vert)
418  deallocate(latbu_vert, lonbu_vert)
419 
420  ! write SCRIP file with land mask, used for mapped ocean mask
421  ! and mesh creation
422  cstagger = trim(staggerlocs(1))
423  fdst= trim(dirout)//'/'//trim(cstagger)//'.mx'//trim(res)//'_SCRIP_land.nc'
424  logmsg = 'creating SCRIP file '//trim(fdst)
425  print '(a)',trim(logmsg)
426  call write_scripgrid(trim(fdst),trim(cstagger),imask=int(wet4))
427  deallocate(latct_vert, lonct_vert)
428 
429  !---------------------------------------------------------------------
430  ! write lat,lon,depth and mask arrays required by ww3 in creating
431  ! mod_def file
432  !---------------------------------------------------------------------
433 
434  write(cnx,i4fmt)nx
435  write(form1,'(a)')'('//trim(cnx)//'f14.8)'
436  write(form2,'(a)')'('//trim(cnx)//'i2)'
437 
438  allocate(ww3mask(1:ni,1:nj)); ww3mask = wet4
439  allocate(ww3dpth(1:ni,1:nj)); ww3dpth = dp4
440 
441  where(latct .ge. maximum_lat)ww3mask = 3
442  !close last row
443  ww3mask(:,nj) = 3
444 
445  open(unit=21,file=trim(dirout)//'/'//'ww3.mx'//trim(res)//'_x.inp',form='formatted')
446  open(unit=22,file=trim(dirout)//'/'//'ww3.mx'//trim(res)//'_y.inp',form='formatted')
447  open(unit=23,file=trim(dirout)//'/'//'ww3.mx'//trim(res)//'_bottom.inp',form='formatted')
448  open(unit=24,file=trim(dirout)//'/'//'ww3.mx'//trim(res)//'_mapsta.inp',form='formatted')
449  ! cice0 .ne. cicen requires obstruction map, should be initialized as zeros (w3grid,ln3032)
450  open(unit=25,file=trim(dirout)//'/'//'ww3.mx'//trim(res)//'_obstr.inp',form='formatted')
451 
452  do j = 1,nj
453  write( 21,trim(form1))lonct(:,j)
454  write( 22,trim(form1))latct(:,j)
455  end do
456  do j = 1,nj
457  write( 23,trim(form1))ww3dpth(:,j)
458  write( 24,trim(form2))ww3mask(:,j)
459  !'obsx' and 'obsy' arrays ???
460  write( 25,trim(form2))ww3mask(:,j)*0
461  write( 25,trim(form2))ww3mask(:,j)*0
462  end do
463 
464  close(21); close(22); close(23); close(24); close(25)
465  deallocate(ww3mask); deallocate(ww3dpth)
466  deallocate(wet4, wet8)
467 
468  !---------------------------------------------------------------------
469  ! use ESMF regridding to produce mapped ocean mask; first generate
470  ! conservative regrid weights from ocean to tiles; then generate the
471  ! tiled files containing the mapped ocean mask
472  !---------------------------------------------------------------------
473 
474  method=esmf_regridmethod_conserve
475  fsrc = trim(dirout)//'/'//'Ct.mx'//trim(res)//'_SCRIP_land.nc'
476  fdst = trim(fv3dir)//'/'//trim(atmres)//'/'//trim(atmres)//'_mosaic.nc'
477  fwgt = trim(dirout)//'/'//'Ct.mx'//trim(res)//'.to.'//trim(atmres)//'.nc'
478  logmsg = 'creating weight file '//trim(fwgt)
479  print '(a)',trim(logmsg)
480 
481  call esmf_regridweightgen(srcfile=trim(fsrc),dstfile=trim(fdst), &
482  weightfile=trim(fwgt), regridmethod=method, &
483  unmappedaction=esmf_unmappedaction_ignore, ignoredegenerate=.true., &
484  netcdf4fileflag=.true., tilefilepath=trim(fv3dir)//'/'//trim(atmres)//'/', rc=rc)
485  if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
486  line=__line__, file=__file__)) call esmf_finalize(endflag=esmf_end_abort)
487 
488  logmsg = 'creating mapped ocean mask for '//trim(atmres)
489  print '(a)',trim(logmsg)
490  call make_frac_land(trim(fsrc), trim(fwgt))
491 
492  !---------------------------------------------------------------------
493  ! use ESMF to find the tripole:tripole weights for creation
494  ! of CICE ICs; the source grid is always mx025; don't create this
495  ! file if destination is also mx025
496  !---------------------------------------------------------------------
497 
498  if(trim(res) .ne. '025') then
499  fsrc = trim(dirout)//'/'//'Ct.mx025_SCRIP.nc'
500  inquire(file=trim(fsrc), exist=fexist)
501  if (fexist ) then
502  method=esmf_regridmethod_nearest_stod
503  fdst = trim(dirout)//'/'//'Ct.mx'//trim(res)//'_SCRIP.nc'
504  fwgt = trim(dirout)//'/'//'tripole.mx025.Ct.to.mx'//trim(res)//'.Ct.neareststod.nc'
505  logmsg = 'creating weight file '//trim(fwgt)
506  print '(a)',trim(logmsg)
507 
508  call esmf_regridweightgen(srcfile=trim(fsrc),dstfile=trim(fdst), &
509  weightfile=trim(fwgt), regridmethod=method, &
510  ignoredegenerate=.true., unmappedaction=esmf_unmappedaction_ignore, rc=rc)
511  if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
512  line=__line__, file=__file__)) call esmf_finalize(endflag=esmf_end_abort)
513  else
514  logmsg = 'ERROR: '//trim(fsrc)//' is required to generate tripole:triple weights'
515  print '(a)',trim(logmsg)
516  stop
517  end if
518  end if
519 
520  !---------------------------------------------------------------------
521  !
522  !---------------------------------------------------------------------
523 
524  if(do_postwgts)call make_postwgts
525 
526  !---------------------------------------------------------------------
527  ! clean up
528  !---------------------------------------------------------------------
529 
530  deallocate(x,y, angq, dx, dy, xsgp1, ysgp1)
531  deallocate(areact, anglet, angle)
532  deallocate(latct, lonct)
533  deallocate(latcv, loncv)
534  deallocate(latcu, loncu)
535  deallocate(latbu, lonbu)
536 
537 end program gen_fixgrid
subroutine, public write_scripgrid(fname, cstagger, imask)
Write a SCRIP grid file.
Definition: scripgrid.F90:34
subroutine make_frac_land(src, wgt)
Use ESMF weights to map the ocean land mask to the FV3 tiles and write the mapped mask to 6 tile file...
Definition: mapped_mask.F90:26
subroutine allocate_all
Allocate grid variables.
Definition: grdvars.F90:173
subroutine fill_vertices(jbeg, jend, iVert, jVert, lat, lon, latvert, lonvert)
Fill the vertices for any stagger location between bounding j-rows.
Definition: vertices.F90:33
subroutine, public checkseam
Print values across the tripole seam.
Definition: debugprint.F90:27
subroutine find_ang
Find the rotation angle on center (Ct) grid points.
Definition: angles.F90:131
subroutine make_postwgts
Create the ESMF weights files to remap velocity points from their native stagger location to the cent...
Definition: postwgts.F90:24
subroutine find_angq
Find the rotation angle on corner grid (Bu) points using the full MOM6 supergrid. ...
Definition: angles.F90:25
subroutine fill_bottom(iVert, jVert, lat, lon, latvert, lonvert, dlat)
Fill the vertices for a stagger location along the bottom j-row.
Definition: vertices.F90:68
subroutine, public write_tripolegrid(fname)
Write the tripole grid file.
Definition: tripolegrid.F90:33
subroutine, public checkpoint
Print values at specified point.
Definition: debugprint.F90:170
subroutine, public apply_topoedits(fsrc)
Read the topoedits file and adjust the bathymetry.
Definition: topoedits.F90:165
subroutine, public add_topoedits(fsrc, fdst)
Read the existing topoedits file, append required topoedits and write a new topoedits file...
Definition: topoedits.F90:32
program gen_fixgrid
Generate fixed grid files required for coupled model using the MOM6 super grid file and ocean mask fi...
Definition: gen_fixgrid.F90:16
subroutine fill_top(iVert, jVert, lat, lon, latvert, lonvert, xlat, xlon)
Fill the vertices for a stagger location along the top j-row.
Definition: vertices.F90:114
subroutine, public checkxlatlon
Print values near the poles and along the domain edges.
Definition: debugprint.F90:108
subroutine, public write_cicegrid(fname)
Write the CICE6 grid file.
Definition: cicegrid.F90:28
subroutine read_inputnml(fname)
Read input namelist file.
Definition: inputnml.F90:24