subroutine maxReservoirP implicit none character(120) :: fname, new_file_name integer iou logical exists include "stdunits.h" include "size.h" include "isleperim.h" include "maxReservoirP.h" real c1, c0 real tmpijk(imt-2,jmt-2,km) integer ib(10), ic(10) c1 = 1. c0 = 0. # if defined O_sediment_P_reservoir fname = new_file_name ("MaxReservoirP.nc") inquire (file=trim(fname), exist=exists) if (.not. exists) then print*, "Error => ", trim(fname), " does not exist." stop 'maxReservoirP in maxReservoirP.f' endif call openfile (fname, iou) ib(:)=1 ic(:)=imt-2 ic(2)=jmt-2 ic(3)=km print*, "ib => ",ib print*, "ic => ",ic if (.not. exists) then print*, "==> Warning: MaxReservoirP data does not exist." else call getvara ('po4_max_reservoir', iou, ic(1)*ic(2)*ic(3), & ib, ic, tmpijk, c1, c0) endif maxResP = tmpijk*1000 actResP = maxResP # if defined O_sediment_P_reservoir_restart fname = new_file_name ("ActReservoirP.nc") inquire (file=trim(fname), exist=exists) if (.not. exists) then print*, "Error => ", trim(fname), " does not exist." stop 'maxReservoirP in maxReservoirP.f' endif call openfile (fname, iou) ib(:)=1 ic(:)=imt-2 ic(2)=jmt-2 ic(3)=km print*, "ib => ",ib print*, "ic => ",ic if (.not. exists) then print*, "==> Warning: ActReservoirP data does not exist." else call getvara ('po4_act_reservoir', iou, ic(1)*ic(2)*ic(3), & ib, ic, tmpijk, c1, c0) endif actResP = tmpijk*1000 # endif # endif return end