*********************************************************************** * MAIN for TSTEROD *********************************************************************** c c +++ PURPOSE +++ c c To start a standalone version of the EROSION submodel c c It calls ERODEIN to read an input file (stdin), c calls ERODINIT to initialize grid, c runs the EROSION submodel code, and c calls ERODOUT to print the generated output (stdout). c c +++ ARGUMENT DECLARATIONS +++ c c + + + GLOBAL COMMON BLOCKS + + + c include 'p1werm.inc' include 'm1flag.inc' c c c + + + LOCAL COMMON BLOCKS c c ++++ ARGUMENT DEFINITIONS +++ c c +++ SUBROUTINES CALLED+++ c erodin c erodinit c erosion c erodout c ++++ LOCAL VARIABLES +++ integer i_unit integer o_unit c c +++ END SPECIFICATIONS +++ c c Set unit numbers for input and output file devices. c (stdin = 5, stdout = 6) c i_unit = 2 c o_unit = 55 i_unit = 5 o_unit = 6 c Open input and output files (if changed from stdin and stdout). if (i_unit .ne. 5) then open (i_unit, file='erod.in') endif if (o_unit .ne. 6) then open(o_unit, file='erod.out' , status='unknown') endif c obtain EROSION (standalone) inputs: C write (*,*) 'call to erodin ' call erodin(i_unit, o_unit) c Initialize erosion code, create grid, etc: c (must come after sim field size, & no. subr specified) C write (*,*) 'call to erodinit ' call erodinit c c write (*,*) 'call to erosion ' c start erosion call erosion (o_unit) c Print output from standalone EROSION submodel run C write (*,*) 'call to erodout ' if (am0efl .eq. 1) then call erodout (o_unit) endif if (i_unit .ne. 5) then close(i_unit) endif if (o_unit .ne. 6) then close(o_unit) endif stop end