Changeset 12253 for utils/tools/NESTING/src/agrif_readwrite.f90
- Timestamp:
- 2019-12-16T10:59:22+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
utils/tools/NESTING/src/agrif_readwrite.f90
r11231 r12253 241 241 CALL write_ncdf_var('nav_lon' ,dimnames,name,Grid%nav_lon ,'float') 242 242 CALL write_ncdf_var('nav_lat' ,dimnames,name,Grid%nav_lat ,'float') 243 CALL write_ncdf_var(parent_level_name,dimnames,name, Grid%bathy_level,'float')243 CALL write_ncdf_var(parent_level_name,dimnames,name,NINT(Grid%bathy_level),'integer') 244 244 ! 245 245 CALL copy_ncdf_att('nav_lon' ,TRIM(parent_bathy_level),name,MINVAL(Grid%nav_lon),MAXVAL(Grid%nav_lon)) … … 548 548 ln_zps = 1 549 549 ln_zco = 0 550 CALL zgr_zps( nx, ny, gdept_1d, gdepw_1d, e3t_1d, e3w_1d, zbathy, & ! input551 & mbathy, e3t_0, e3u_0, e3v_0, e3f_0, e3w_0, e3uw_0, e3vw_0 ) ! output552 550 ELSE 553 551 ln_zps = 0 554 552 ln_zco = 1 555 553 ENDIF 554 555 CALL zgr_zps( nx, ny, gdept_1d, gdepw_1d, e3t_1d, e3w_1d, zbathy, & ! input 556 & mbathy, e3t_0, e3u_0, e3v_0, e3f_0, e3w_0, e3uw_0, e3vw_0 ) ! output 556 557 557 558 ! top/bottom levels … … 869 870 END WHERE 870 871 871 ! Compute mbathy for ocean points (i.e. the number of ocean levels) 872 ! find the number of ocean levels such that the last level thickness 873 ! is larger than the minimum of e3zps_min and e3zps_rat * e3t_1d (where 874 ! e3t_1d is the reference level thickness 875 DO jk = N-1, 1, -1 876 zdepth = gdepw_1d(jk) + MIN( e3zps_min, e3t_1d(jk)*e3zps_rat ) 877 WHERE( 0. < zbathy(:,:) .AND. zbathy(:,:) <= zdepth ) mbathy(:,:) = jk-1 878 END DO 879 872 IF( partial_steps ) THEN 873 ! Compute mbathy for ocean points (i.e. the number of ocean levels) 874 ! find the number of ocean levels such that the last level thickness 875 ! is larger than the minimum of e3zps_min and e3zps_rat * e3t_1d (where 876 ! e3t_1d is the reference level thickness 877 DO jk = N-1, 1, -1 878 zdepth = gdepw_1d(jk) + MIN( e3zps_min, e3t_1d(jk)*e3zps_rat ) 879 WHERE( 0. < zbathy(:,:) .AND. zbathy(:,:) <= zdepth ) mbathy(:,:) = jk-1 880 END DO 881 ELSE 882 DO jk = 1, N 883 WHERE( 0. < zbathy(:,:) .AND. zbathy(:,:) >= gdepw_1d(jk) ) mbathy(:,:) = jk-1 884 END DO 885 ENDIF 886 880 887 ! Scale factors and depth at T- and W-points 881 888 DO jk = 1, N ! intitialization to the reference z-coordinate … … 890 897 !! IF ( ln_isfcav == 1 ) CALL zgr_isf 891 898 ! 892 ! Scale factors and depth at T- and W-points 893 ! IF ( ln_isfcav == 0 ) THEN 899 IF( partial_steps ) THEN 900 ! Scale factors and depth at T- and W-points 901 ! IF ( ln_isfcav == 0 ) THEN 894 902 DO jj = 1, ny 895 903 DO ji = 1, nx … … 913 921 ELSE ; gdepw_0(ji,jj,ik+1) = gdepw_1d(ik+1) 914 922 ENDIF 915 !gm Bug? check the gdepw_1d923 !gm Bug? check the gdepw_1d 916 924 ! ... on ik 917 925 gdept_0(ji,jj,ik) = gdepw_1d(ik) + ( gdepw_0(ji,jj,ik+1) - gdepw_1d(ik) ) & … … 931 939 END DO 932 940 ! 933 ! DO jj = 1, ny 934 ! DO ji = 1, nx 935 ! ik = mbathy(ji,jj) 936 ! IF( ik > 0 ) THEN ! ocean point only 937 ! e3tp (ji,jj) = e3t_0(ji,jj,ik) 938 ! e3wp (ji,jj) = e3w_0(ji,jj,ik) 939 ! ENDIF 940 ! END DO 941 ! END DO 942 ! END IF 941 ! DO jj = 1, ny 942 ! DO ji = 1, nx 943 ! ik = mbathy(ji,jj) 944 ! IF( ik > 0 ) THEN ! ocean point only 945 ! e3tp (ji,jj) = e3t_0(ji,jj,ik) 946 ! e3wp (ji,jj) = e3w_0(ji,jj,ik) 947 ! ENDIF 948 ! END DO 949 ! END DO 950 ! END IF 951 ENDIF 943 952 ! 944 953 ! Scale factors and depth at U-, V-, UW and VW-points
Note: See TracChangeset
for help on using the changeset viewer.