Changeset 5879 for branches/UKMO
- Timestamp:
- 2015-11-12T15:52:57+01:00 (9 years ago)
- Location:
- branches/UKMO/icebergs_restart_single_file/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/icebergs_restart_single_file/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90
r5865 r5879 70 70 TYPE(iceberg) :: localberg ! NOT a pointer but an actual local variable 71 71 TYPE(point) :: localpt ! NOT a pointer but an actual local variable 72 REAL(wp), DIMENSION(1,nkounts) :: rdata_in 72 REAL(wp), DIMENSION(1,nkounts) :: zdata_in 73 INTEGER :: ii,ij 73 74 !!---------------------------------------------------------------------- 74 75 … … 83 84 84 85 ibergs_in_file = iom_file(ncid)%lenuld 85 IF(lwp) WRITE(numout,*) '>>> Number of bergs in local file : ',ibergs_in_file86 86 DO jn = 1,ibergs_in_file 87 87 … … 92 92 CALL iom_get( ncid, 'yj' ,localpt%yj , ktime=jn ) 93 93 94 IF(lwp) WRITE(numout, *) '>>> Found iceberg ',jn,' at (i,j) ',localpt%xi,',',localpt%yj 95 IF(lwp) WRITE(numout, *) '>>> nldi, nlei, nldj, nlej, nimpp, njmpp ',nldi, nlei, nldj, nlej, nimpp, njmpp 96 97 ! Only proceed if this iceberg is on the local processor (including halos). 98 IF ( localpt%xi .GE. nimpp .AND. localpt%xi .LE. nimpp+jpi-1 .AND. & 99 & localpt%yj .GE. njmpp .AND. localpt%yj .LE. njmpp+jpj-1 ) THEN 100 101 CALL iom_get( ncid, jpdom_unknown, 'number' , (/rdata_in(1,:)/) , ktime=jn, kstart=(/1/), kcount=(/nkounts/) ) 102 localberg%number(:) = INT(rdata_in(1,:)) 94 ii = INT( localpt%xi + 0.5 ) 95 ij = INT( localpt%yj + 0.5 ) 96 ! Only proceed if this iceberg is on the local processor (excluding halos). 97 IF ( ii .GE. nldi+nimpp-1 .AND. ii .LE. nlei+nimpp-1 .AND. & 98 & ij .GE. nldj+njmpp-1 .AND. ij .LE. nlej+njmpp-1 ) THEN 99 100 CALL iom_get( ncid, jpdom_unknown, 'number' , (/zdata_in(1,:)/) , ktime=jn, kstart=(/1/), kcount=(/nkounts/) ) 101 localberg%number(:) = INT(zdata_in(1,:)) 103 102 CALL iom_get( ncid, 'mass_scaling' , localberg%mass_scaling, ktime=jn ) 104 103 CALL iom_get( ncid, 'lon' , localpt%lon , ktime=jn ) … … 110 109 CALL iom_get( ncid, 'width' , localpt%width , ktime=jn ) 111 110 CALL iom_get( ncid, 'length' , localpt%length , ktime=jn ) 112 CALL iom_get( ncid, 'year' , rdata_in(1,1) , ktime=jn )113 localpt%year = INT( rdata_in(1,1))111 CALL iom_get( ncid, 'year' , zdata_in(1,1) , ktime=jn ) 112 localpt%year = INT(zdata_in(1,1)) 114 113 CALL iom_get( ncid, 'day' , localpt%day , ktime=jn ) 115 114 CALL iom_get( ncid, 'mass_of_bits' , localpt%mass_of_bits , ktime=jn ) … … 117 116 118 117 ! 119 IF(lwp) WRITE(numout, *) '>>> Initialising iceberg ',jn,' at (i,j) ',localpt%xi,',',localpt%yj120 118 CALL icb_utl_add( localberg, localpt ) 121 119 … … 132 130 CALL iom_get( ncid, jpdom_autoglo_xy, 'stored_ice' , berg_grid%stored_ice, kstart=(/1,1,1/), kcount=(/1,1,nclasses/) ) 133 131 134 CALL iom_get( ncid, jpdom_unknown, 'kount' , (/ rdata_in(1,:)/) )135 num_bergs(:) = INT( rdata_in(1,:))132 CALL iom_get( ncid, jpdom_unknown, 'kount' , (/zdata_in(1,:)/) ) 133 num_bergs(:) = INT(zdata_in(1,:)) 136 134 137 135 ! Finish up … … 143 141 WRITE(numout,'(2(a,i5))') 'icebergs, read_restart_bergs: # bergs =',jn,' on PE',narea-1 144 142 IF( lk_mpp ) THEN 145 CALL mpp_sum(ibergs_in_file) 143 ! Only mpp_sum ibergs_in_file if we are reading from multiple restart files. 144 WRITE(numout,*) 'iom_file(ncid)%name : ',iom_file(ncid)%name 145 WRITE(numout,*) "INDEX(iom_file(ncid)%name,'icebergs.nc' ) : ",INDEX(iom_file(ncid)%name,'icebergs.nc' ) 146 IF( INDEX(iom_file(ncid)%name,'icebergs.nc' ) .EQ. 0 ) CALL mpp_sum(ibergs_in_file) 146 147 CALL mpp_sum(jn) 147 148 ENDIF -
branches/UKMO/icebergs_restart_single_file/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
r5865 r5879 673 673 CHARACTER(LEN=256) :: clname ! file name 674 674 CHARACTER(LEN=1) :: clrankpv, cldmspc ! 675 LOGICAL :: ll_depth_spec ! T => if kstart, kcount present then *only* use values for 3rd spatial dimension. 675 676 !--------------------------------------------------------------------- 676 677 ! … … 719 720 ! update idom definition... 720 721 ! Identify the domain in case of jpdom_auto(glo/dta) definition 722 IF( idom == jpdom_autoglo_xy ) THEN 723 ll_depth_spec = .TRUE. 724 idom = jpdom_autoglo 725 ELSE 726 ll_depth_spec = .FALSE. 727 ENDIF 721 728 IF( idom == jpdom_autoglo .OR. idom == jpdom_autodta ) THEN 722 729 IF( idom == jpdom_autoglo ) THEN ; idom = jpdom_global … … 772 779 istart(idmspc+1) = itime 773 780 774 IF( PRESENT(kstart) .AND. idom /= jpdom_autoglo_xy) THEN ; istart(1:idmspc) = kstart(1:idmspc) ; icnt(1:idmspc) = kcount(1:idmspc)781 IF( PRESENT(kstart) .AND. .NOT. ll_depth_spec ) THEN ; istart(1:idmspc) = kstart(1:idmspc) ; icnt(1:idmspc) = kcount(1:idmspc) 775 782 ELSE 776 783 IF( idom == jpdom_unknown ) THEN ; icnt(1:idmspc) = idimsz(1:idmspc) … … 798 805 IF( PRESENT(pv_r3d) ) THEN 799 806 IF( idom == jpdom_data ) THEN ; icnt(3) = jpkdta 800 ELSE IF( idom == jpdom_autoglo_xy .AND. PRESENT(kstart) ) THEN; istart(3) = kstart(3); icnt(3) = kcount(3)807 ELSE IF( ll_depth_spec .AND. PRESENT(kstart) ) THEN ; istart(3) = kstart(3); icnt(3) = kcount(3) 801 808 ELSE ; icnt(3) = jpk 802 809 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.