Opened 5 years ago

Closed 5 years ago

#205 closed defect (fixed)

routing_irrigmap: nix and njx are not initialized when they do not belong to mpi root processor

Reported by: ajornet Owned by: somebody
Priority: major Milestone: orchidee_1_9_6
Component: Driver files Version: trunc
Keywords: routing routing_irrigmap nix njx initilization Cc:

Description

Under routing_irrigmap variables nix and njx are only initialized when they belong to mpi root processor. So they do not get a initial value. But later used printing its value.

7792	    IF (is_root_prc) THEN
7793	       nix=INT(MAXVAL(resolution_g(:,1))/MAXVAL(resol_lu(:,:,1)))+2
7794	       njx=INT(MAXVAL(resolution_g(:,2))/MAXVAL(resol_lu(:,:,2)))+2
7795	       nbpmax = nix*njx*2
7796	    ENDIF
7797	    CALL bcast(nbpmax)
7798	    !
7799	    callsign = 'Irrigation map'
7800	    ok_interpol = .FALSE.
7801	    !
7802	    WRITE(numout,*) "Projection arrays for ",callsign," : "
7803	    WRITE(numout,*) "nbpmax = ",nbpmax, nix, njx

Proposed solution:

7793	    nix=INT(MAXVAL(resolution_g(:,1))/MAXVAL(resol_lu(:,:,1)))+2
7794	    njx=INT(MAXVAL(resolution_g(:,2))/MAXVAL(resol_lu(:,:,2)))+2
7795	    nbpmax = nix*njx*2
7798	    !
7799	    callsign = 'Irrigation map'
7800	    ok_interpol = .FALSE.
7801	    !
7802	    WRITE(numout,*) "Projection arrays for ",callsign," : "
7803	    WRITE(numout,*) "nbpmax = ",nbpmax, nix, njx

This way it ensures nix and njx will get be initialized. It is not the most optimal proposal but it keeps consistency regarding routing_basins.

4236	    ! 
4237	    nix=INT(MAXVAL(resolution_g(:,1))/MAXVAL(resol_lu(:,:,1)))+2
4238	    njx=INT(MAXVAL(resolution_g(:,2))/MAXVAL(resol_lu(:,:,2)))+2
4239	    nbvmax = nix*njx*2
4240	    !
4241	    ! We are on the root processor here as this routine is not in parallel. So no need to broadcast.
4242	    !

Change History (2)

comment:1 Changed 5 years ago by ajornet

I applied this fix at r2948.

comment:2 Changed 5 years ago by jgipsl

  • Resolution set to fixed
  • Status changed from new to closed

Done rev [2963] : write moved to IF is_root_prc

Note: See TracTickets for help on using tickets.