! DTYPEMOD.F90 Demonstrate use of a module to allow passing ! a derived-type argument ! Also shows WRITE of a derived-type ! Compare to DTYPEARG.F90 ! ! Expected output is: ! 2 1 ! ! Compile using ! df dtypemod.f90 ! If using Developer's Studio, use the default Project Settings. ! MODULE m TYPE pair INTEGER ub, lb END TYPE END MODULE !________________________ DTYPEMOD.F90 USE m TYPE (pair) p CALL jones (p) WRITE (*,*) p END !________________________ SUBROUTINE jones (p) USE m TYPE (pair) p p.ub = 2 p.lb = 1 END SUBROUTINE