Opened 7 years ago
Last modified 2 years ago
#1870 closed Bug
NESTING TOOLS AGRIF create restart files — at Version 7
Reported by: | jharlass | Owned by: | sciliberti |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | AGRIF | Version: | v3.6 |
Severity: | major | Keywords: | AGRIF Tools nesting restartability v3.6 |
Cc: | sciliberti |
Description (last modified by nicolasmartin)
Context
AGRIF NESTING TOOLS: agrif_create_restart.exe does not work with current NEMO 3.6 version
Analysis
Create restart file for AGRIF NEST from base model restart (global file).
- Restart variables of current NEMO version were unknown to nesting tools.
- The nest grid can have deeper values than the base grid, if e.g. bathymetry created with ETOPO. Happens in the near bottom levels in ragged bathymetry. Since there are no vlaues to inter/extrapolate they remain zero which causes the model to crash after a few time steps as e.g. zero salinity causes huge gradients, creating instabilty and so on ...
Fix
- Add all variables needed.
- New routine ("check_interpextrap") that checks for such missing values and replaces them with values from 1 level above.
CHANGES IN: NESTING/src/agrif_create_restart.f90:
-
(a) Revision vs. (b) Working
a b 436 458 ENDIF 437 459 ! 438 460 ! Variable interpolation according to their position on grid 439 ! 440 CASE('un','ub') 461 ! 462 ! grid U 463 ! 3D 464 CASE('un','ub','avu','avmu') 465 ! irec only for DIMG format ! 441 466 varname = Ncdf_varname(i) 442 443 467 IF(TRIM(varname)=='un') irec = 6 * z + 2 444 468 IF(TRIM(varname)=='ub') irec = 2 445 446 WRITE(*,*) TRIM(varname),'interpolation ...' 469 ! WRITE(*,*) TRIM(varname),'interpolation ...' 447 470 vert_coord_name = 'z' 448 471 posvar='U' 449 472 Interpolation = .TRUE. 450 ! 451 CASE('u_io' )473 ! 1D 474 CASE('u_io','ssu_m','utau_b') 452 475 varname = Ncdf_varname(i) 453 WRITE(*,*) TRIM(varname),'interpolation ...'476 ! WRITE(*,*) TRIM(varname),'interpolation ...' 454 477 vert_coord_name = 'z_b' 455 478 posvar='U' 456 479 Interpolation = .TRUE. 457 ! 458 CASE('vn','vb') 480 ! 481 ! grid V 482 ! 3D 483 CASE('vn','vb','avmv') 459 484 varname = Ncdf_varname(i) 460 461 485 IF(TRIM(varname)=='vn') irec = 7 * z + 2 462 486 IF(TRIM(varname)=='vb') irec = 2 + z 463 464 WRITE(*,*) TRIM(varname),'interpolation ...' 487 ! WRITE(*,*) TRIM(varname),'interpolation ...' 465 488 vert_coord_name = 'z' 466 489 posvar='V' 467 490 Interpolation = .TRUE. 468 ! 469 CASE('v_io' )491 ! 1D 492 CASE('v_io','ssv_m','vtau_b') 470 493 varname = Ncdf_varname(i) 471 WRITE(*,*) TRIM(varname),'interpolation ...'494 ! WRITE(*,*) TRIM(varname),' interpolation ...' 472 495 vert_coord_name = 'z_b' 473 496 posvar='V' 474 497 Interpolation = .TRUE. 475 ! 476 CASE('gcx','gcxb','sshb','sshn','sst_io','sss_io','gsst') 477 varname = Ncdf_varname(i) 478 479 IF(TRIM(varname)=='gcx') irec = 12 * z + 2 480 IF(TRIM(varname)=='gcxb') irec = 12 * z + 3 481 IF(TRIM(varname)=='sshb') irec = 12 * z + 4 482 IF(TRIM(varname)=='sshn') irec = 12 * z + 5 483 484 WRITE(*,*) TRIM(varname),'interpolation ...' 485 vert_coord_name = 'z_b' 486 posvar='T' 487 Interpolation = .TRUE. 488 489 ! 490 CASE ('tb','sb','sn','tn') 498 ! 499 ! grid T 500 ! 3D 501 CASE ('tb','sb','tn','sn','en','avt','avm','dissl','rhop','qsr_hc_b') 491 502 varname = Ncdf_varname(i) 492 493 503 IF(TRIM(varname)=='sn') irec = 9 * z + 2 494 504 IF(TRIM(varname)=='tn') irec = 8 * z + 2 495 505 IF(TRIM(varname)=='sb') irec = 3 * z + 2 496 506 IF(TRIM(varname)=='tb') irec = 2 * z + 2 497 498 WRITE(*,*) TRIM(varname),'interpolation ...' 507 IF(TRIM(varname)=='tb') irec = 2 * z + 2 508 IF(TRIM(varname)=='en') irec = 12* z + 6 509 ! WRITE(*,*) TRIM(varname),' interpolation ...' 499 510 vert_coord_name = 'z' 500 511 posvar='T' 501 512 Interpolation = .TRUE. 502 503 CASE('en') 504 varname = Ncdf_varname(i) 505 irec = 12 * z + 6 506 WRITE(*,*) TRIM(varname),'interpolation ...' 507 vert_coord_name = 'z' 513 ! 1D 514 CASE('gcx','gcxb','sshb','sshn','sst_io','sss_io','gsst','sss_m','sst_m','ssh_m','frq_m','qns_b','emp_b','sfx_b','sbc_hc_b','sbc_sc_b','fraqsr_1lev') 515 varname = Ncdf_varname(i) 516 IF(TRIM(varname)=='gcx') irec = 12 * z + 2 517 IF(TRIM(varname)=='gcxb') irec = 12 * z + 3 518 IF(TRIM(varname)=='sshb') irec = 12 * z + 4 519 IF(TRIM(varname)=='sshn') irec = 12 * z + 5 520 ! WRITE(*,*) TRIM(varname),' interpolation ...' 521 vert_coord_name = 'z_b' 508 522 posvar='T' 509 Interpolation = .TRUE. 510 523 Interpolation = .TRUE. 524 ! 525 ! NO interpolation 526 ! 511 527 CASE ('rotb','rotn','hdivb','hdivn') 512 528 Interpolation = .FALSE. 513 529 !
FULL COURCE CODE ATTACHED:
NESTING/src/agrif_create_restart.f90
and
NESTING/src/agrif_extrapolation.f90 with new routine: "check_interpextrap"
Commit History (0)
(No commits)
Change History (9)
Changed 7 years ago by jharlass
comment:1 Changed 7 years ago by nemo
- Keywords CREATE removed
comment:2 Changed 7 years ago by nemo
- Keywords nesting added; NESTING removed
comment:3 Changed 7 years ago by nemo
- Keywords restart added; RESTART removed
comment:4 Changed 7 years ago by nemo
- Keywords tools added; TOOLS removed
comment:5 Changed 7 years ago by mdunphy
Hi Jan,
Thanks for this, it eliminates a bunch of post-processing work to fix up the partial steps. There's a typo in the allocations in check_interpextrap (see attached patch), but otherwise it looks good!
Changed 7 years ago by mdunphy
Fix for the allocations in check_interpextrap(). This patch is for agrif_extrapolation.f90 attached to this ticket (#1870), not for the version under SVN.
comment:6 Changed 7 years ago by clevy
- Owner changed from nemo to sciliberti
comment:7 Changed 7 years ago by nicolasmartin
- Description modified (diff)
routine checking for missing values: check_interpextrap